2022-03-18 12:47:34 +04:00
|
|
|
|
using CoreModels.ModelsSecurity;
|
|
|
|
|
using ModuleTools.Attributes;
|
2021-03-28 19:15:55 +04:00
|
|
|
|
using ModuleTools.Enums;
|
|
|
|
|
using ModuleTools.ViewModels;
|
2021-03-26 20:09:52 +04:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace SecurityBusinessLogic.ViewModels
|
|
|
|
|
{
|
2022-03-18 12:47:34 +04:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Список достпуов
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class AccessListViewModel : ListViewModel<AccessViewModel> { }
|
2021-03-26 20:09:52 +04:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Элемент доступа
|
|
|
|
|
/// </summary>
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlElementClass()]
|
2022-03-18 12:47:34 +04:00
|
|
|
|
public class AccessViewModel : ElementViewModel, IAccessModel
|
2021-03-26 20:09:52 +04:00
|
|
|
|
{
|
2021-04-02 16:06:12 +04:00
|
|
|
|
[ViewModelControlElementProperty("Роль", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = true, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleList, SecurityWindowsDesktop")]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public Guid RoleId { get; set; }
|
|
|
|
|
|
2021-04-03 13:50:58 +04:00
|
|
|
|
[ViewModelControlListProperty("Роль", ColumnWidth = 100)]
|
2021-04-13 12:52:45 +04:00
|
|
|
|
[MapConfiguration("Role.ToString", IsDifficle = true, AllowCopyWithoutRigth = false)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public string RoleName { get; set; }
|
|
|
|
|
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlElementProperty("Операция", ControlType.ControlEnum, MustHaveValue = true)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public AccessOperation AccessOperation { get; set; }
|
|
|
|
|
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlListProperty("Операция")]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public string AccessOperationTitle => AccessOperation.ToString("G");
|
|
|
|
|
|
2021-04-01 21:30:29 +04:00
|
|
|
|
[ViewModelControlElementProperty("Тип", ControlType.ControlEnum, MustHaveValue = true)]
|
2021-03-26 20:09:52 +04:00
|
|
|
|
public AccessType AccessType { get; set; }
|
|
|
|
|
|
2021-04-03 13:50:58 +04:00
|
|
|
|
[ViewModelControlListProperty("Тип", ColumnWidth = 150)]
|
2021-03-28 19:58:42 +04:00
|
|
|
|
public string AccessTypeTitle => AccessType switch
|
2021-03-28 00:15:01 +04:00
|
|
|
|
{
|
2021-03-28 19:58:42 +04:00
|
|
|
|
AccessType.Delete => "Полные права",
|
|
|
|
|
AccessType.Change => "Просмотр, Редактирование",
|
|
|
|
|
AccessType.View => "Просмотр",
|
|
|
|
|
_ => "Неопределено",
|
|
|
|
|
};
|
2021-03-26 20:09:52 +04:00
|
|
|
|
}
|
|
|
|
|
}
|