45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using xModels.Base;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace xIdentityModels.Models
|
|
{
|
|
/// <summary>
|
|
/// a Role Definition Model (mirror of ASP.NET IdentityRole + Weight) ...
|
|
/// </summary>
|
|
public class XRoleDefinition : XBaseIntIDEntity
|
|
{
|
|
/// <summary>
|
|
/// Unique Normalized Role Name, e.g. chief_clerk ...
|
|
/// </summary>
|
|
[Required]
|
|
[StringLength(256)]
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// Persian Display Name, e.g. سر دبیر ...
|
|
/// </summary>
|
|
[StringLength(255)]
|
|
public string DisplayName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Role Weight, same as XUserRole enum (user=0 ... admin=10) ...
|
|
/// </summary>
|
|
public int Weight { get; set; }
|
|
|
|
/// <summary>
|
|
/// Optional Parent Role for Inheritance ...
|
|
/// </summary>
|
|
[StringLength(256)]
|
|
public string ParentRoleName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Is Enabled ...
|
|
/// </summary>
|
|
public bool IsEnabled { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Seeded from Constants, cannot be removed ...
|
|
/// </summary>
|
|
public bool IsSystem { get; set; }
|
|
}
|
|
} |