using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Abp.Domain.Entities; using Abp.Domain.Entities.Auditing; namespace IwbZero.Authorization.Base.Permissions { /// /// Used to grant/deny a permission for a role or user. /// [Table("Sys_Permissions")] public class PermissionSetting : CreationAuditedEntity, IMayHaveTenant { /// /// Maximum length of the field. /// public const int NameMaxLength = 500; public const int MasterValueMaxLength = 100; public const int AccessValueMaxLength = 500; public virtual int? TenantId { get; set; } /// /// Unique name of the permission. /// [Required] [StringLength(NameMaxLength)] public virtual string Name { get; set; } public int? Master { get; set; } [StringLength(MasterValueMaxLength)] public string MasterValue { get; set; } public int? Access { get; set; } [StringLength(AccessValueMaxLength)] public string AccessValue { get; set; } /// /// Is this role granted for this permission. /// Default value: true. /// public virtual bool IsGranted { get; set; } /// /// Creates a new entity. /// public PermissionSetting() => IsGranted = true; } }