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