DD.WellWorkover.Cloud/AsbCloudApp/Data/User/UserRoleDto.cs

37 lines
1.0 KiB
C#
Raw Normal View History

using System.Collections.Generic;
2023-02-20 12:18:45 +05:00
using System.ComponentModel.DataAnnotations;
using System.Linq;
2021-09-10 11:28:57 +05:00
2024-08-19 10:01:07 +05:00
namespace AsbCloudApp.Data.User;
/// <summary>
/// Роль пользователя платформы
/// </summary>
public class UserRoleDto : IId
2021-09-10 11:28:57 +05:00
{
2024-08-19 10:01:07 +05:00
/// <inheritdoc/>
public int Id { get; set; }
2022-06-02 12:35:51 +05:00
/// <summary>
2024-08-19 10:01:07 +05:00
/// название
2022-06-02 12:35:51 +05:00
/// </summary>
2024-08-19 10:01:07 +05:00
[Required]
[StringLength(50, MinimumLength = 1, ErrorMessage = "Допустимая длина названия роли от 1 до 50 символов")]
public string Caption { get; set; } = null!;
2022-06-02 12:35:51 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// id типа роли
/// </summary>
public int IdType { get; set; }
2022-06-02 12:35:51 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// список разрешений
/// </summary>
public IEnumerable<PermissionDto> Permissions { get; set; } = Enumerable.Empty<PermissionDto>();
2022-06-02 12:35:51 +05:00
2024-08-19 10:01:07 +05:00
/// <summary>
/// Включенные роли
/// </summary>
public virtual IEnumerable<UserRoleDto> Roles { get; set; } = Enumerable.Empty<UserRoleDto>();
2021-09-10 11:28:57 +05:00
}