| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | |
| | | 3 | | namespace OzonDomains.Models.Authorization; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Прикладная роль (надстройка над Identity). Содержит набор разрешений на страницы, поля и наборы данных. |
| | | 7 | | /// </summary> |
| | | 8 | | public class AppRole |
| | | 9 | | { |
| | 53 | 10 | | public int Id { get; set; } |
| | | 11 | | |
| | | 12 | | [Required, MaxLength(150)] |
| | 214 | 13 | | public string Name { get; set; } = string.Empty; |
| | | 14 | | |
| | | 15 | | [Required, MaxLength(300)] |
| | 142 | 16 | | public string DisplayName { get; set; } = string.Empty; |
| | | 17 | | |
| | | 18 | | [MaxLength(1000)] |
| | 0 | 19 | | public string? Description { get; set; } |
| | | 20 | | |
| | | 21 | | /// <summary>Системные роли нельзя удалить (SuperAdmin, User).</summary> |
| | 0 | 22 | | public bool IsSystem { get; set; } |
| | | 23 | | |
| | 126 | 24 | | public bool IsActive { get; set; } = true; |
| | | 25 | | |
| | 89 | 26 | | public DateTime CreatedAt { get; set; } = DateTime.UtcNow; |
| | 89 | 27 | | public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; |
| | | 28 | | |
| | 89 | 29 | | public virtual ICollection<RolePagePermission> PagePermissions { get; set; } = new List<RolePagePermission>(); |
| | 89 | 30 | | public virtual ICollection<RoleFieldPermission> FieldPermissions { get; set; } = new List<RoleFieldPermission>(); |
| | 89 | 31 | | public virtual ICollection<RoleDataScope> DataScopes { get; set; } = new List<RoleDataScope>(); |
| | 89 | 32 | | public virtual ICollection<UserAppRole> UserLinks { get; set; } = new List<UserAppRole>(); |
| | | 33 | | } |