< Summary

Information
Class: OzonOrdersWeb.Areas.Admin.Models.RoleFieldMatrixRow
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Admin/Models/RoleViewModels.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 104
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_FieldId()100%210%
get_EntityName()100%210%
get_FieldName()100%210%
get_DisplayName()100%210%
get_CanRead()100%210%
get_CanWrite()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/Admin/Models/RoleViewModels.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2
 3namespace OzonOrdersWeb.Areas.Admin.Models;
 4
 5/// <summary>
 6/// Модель представления списка ролей для экрана /Admin/Roles.
 7/// </summary>
 8public class RoleListItemVm
 9{
 10    public int Id { get; set; }
 11    public string Name { get; set; } = string.Empty;
 12    public string DisplayName { get; set; } = string.Empty;
 13    public string? Description { get; set; }
 14    public bool IsSystem { get; set; }
 15    public bool IsActive { get; set; }
 16    public int UserCount { get; set; }
 17    public int PagePermissionCount { get; set; }
 18}
 19
 20/// <summary>
 21/// Модель формы создания/редактирования основного описания роли.
 22/// </summary>
 23public class RoleEditVm
 24{
 25    public int Id { get; set; }
 26
 27    [Required(ErrorMessage = "Укажите системное имя роли")]
 28    [StringLength(150)]
 29    [Display(Name = "Системное имя")]
 30    public string Name { get; set; } = string.Empty;
 31
 32    [Required(ErrorMessage = "Укажите отображаемое имя")]
 33    [StringLength(300)]
 34    [Display(Name = "Отображаемое имя")]
 35    public string DisplayName { get; set; } = string.Empty;
 36
 37    [StringLength(1000)]
 38    [Display(Name = "Описание")]
 39    public string? Description { get; set; }
 40
 41    [Display(Name = "Системная роль")]
 42    public bool IsSystem { get; set; }
 43
 44    [Display(Name = "Активна")]
 45    public bool IsActive { get; set; } = true;
 46}
 47
 48/// <summary>
 49/// Строка матрицы прав на странице для заданной роли.
 50/// </summary>
 51public class RolePageMatrixRow
 52{
 53    public int PageId { get; set; }
 54    public int? ParentId { get; set; }
 55    public int Depth { get; set; }
 56    public string Code { get; set; } = string.Empty;
 57    public string DisplayName { get; set; } = string.Empty;
 58    public string? Icon { get; set; }
 59    public string? AccentClass { get; set; }
 60    public bool IsSectionHeader { get; set; }
 61    public bool CanView { get; set; }
 62    public bool CanCreate { get; set; }
 63    public bool CanEdit { get; set; }
 64    public bool CanDelete { get; set; }
 65    public bool CanExport { get; set; }
 66}
 67
 68/// <summary>
 69/// Строка матрицы прав на поле для заданной роли.
 70/// </summary>
 71public class RoleFieldMatrixRow
 72{
 073    public int FieldId { get; set; }
 074    public string EntityName { get; set; } = string.Empty;
 075    public string FieldName { get; set; } = string.Empty;
 076    public string DisplayName { get; set; } = string.Empty;
 077    public bool CanRead { get; set; }
 078    public bool CanWrite { get; set; }
 79}
 80
 81/// <summary>
 82/// Параметры для AJAX-сохранения матрицы прав.
 83/// </summary>
 84public class RolePagePermissionInput
 85{
 86    public int PageId { get; set; }
 87    public bool CanView { get; set; }
 88    public bool CanCreate { get; set; }
 89    public bool CanEdit { get; set; }
 90    public bool CanDelete { get; set; }
 91    public bool CanExport { get; set; }
 92}
 93
 94public class RoleFieldPermissionInput
 95{
 96    public int FieldId { get; set; }
 97    public bool CanRead { get; set; }
 98    public bool CanWrite { get; set; }
 99}
 100
 101public class RoleDataScopeInput
 102{
 103    public int[] DataScopeIds { get; set; } = System.Array.Empty<int>();
 104}