| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | |
| | | 3 | | namespace OzonDomains.Models.Authorization; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Набор данных (row-level фильтр) для конкретной сущности. |
| | | 7 | | /// FilterExpression — Dynamic LINQ выражение, применяемое к IQueryable. |
| | | 8 | | /// </summary> |
| | | 9 | | public class DataScope |
| | | 10 | | { |
| | 25 | 11 | | public int Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Required, MaxLength(150)] |
| | 48 | 14 | | public string Code { get; set; } = string.Empty; |
| | | 15 | | |
| | | 16 | | [Required, MaxLength(300)] |
| | 38 | 17 | | public string DisplayName { get; set; } = string.Empty; |
| | | 18 | | |
| | | 19 | | [Required, MaxLength(150)] |
| | 48 | 20 | | public string EntityName { get; set; } = string.Empty; |
| | | 21 | | |
| | | 22 | | /// <summary>Dynamic LINQ выражение, например: "CreatedById == @userId".</summary> |
| | | 23 | | [Required] |
| | 48 | 24 | | public string FilterExpression { get; set; } = string.Empty; |
| | | 25 | | |
| | | 26 | | [MaxLength(2000)] |
| | 0 | 27 | | public string? Description { get; set; } |
| | | 28 | | |
| | 38 | 29 | | public bool IsActive { get; set; } = true; |
| | | 30 | | |
| | 25 | 31 | | public DateTime CreatedAt { get; set; } = DateTime.UtcNow; |
| | 25 | 32 | | public DateTime UpdatedAt { get; set; } = DateTime.UtcNow; |
| | | 33 | | |
| | 25 | 34 | | public virtual ICollection<RoleDataScope> RoleLinks { get; set; } = new List<RoleDataScope>(); |
| | 25 | 35 | | public virtual ICollection<UserDataScope> UserLinks { get; set; } = new List<UserDataScope>(); |
| | | 36 | | } |