2021-03-26 20:09:52 +04:00
|
|
|
|
using ModelTools.Attributes;
|
|
|
|
|
using ModelTools.Enums;
|
|
|
|
|
using ModelTools.ViewModels;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SecurityBusinessLogic.ViewModels
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список достпуов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class AccessListViewModel : ListViewModel<AccessViewModel> { }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Элемент доступа
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class AccessViewModel : ElementViewModel
|
|
|
|
|
{
|
|
|
|
|
[MapConfiguration("RoleId")]
|
|
|
|
|
public Guid RoleId { get; set; }
|
|
|
|
|
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Роль", 100)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
[MapConfiguration("Role.RoleName", true)]
|
|
|
|
|
public string RoleName { get; set; }
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("AccessOperation")]
|
|
|
|
|
public AccessOperation AccessOperation { get; set; }
|
|
|
|
|
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Операция")]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public string AccessOperationTitle => AccessOperation.ToString("G");
|
|
|
|
|
|
|
|
|
|
[MapConfiguration("AccessType")]
|
|
|
|
|
public AccessType AccessType { get; set; }
|
|
|
|
|
|
2021-03-27 23:50:29 +04:00
|
|
|
|
[ViewModelOnListProperty("Тип", 150)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public string AccessTypeTitle => AccessType.ToString("G");
|
|
|
|
|
|
|
|
|
|
public override string ToString() => $"{RoleName}-{AccessOperationTitle}({AccessTypeTitle})";
|
|
|
|
|
}
|
|
|
|
|
}
|