< Summary

Information
Class: OzonDomains.Models.Authorization.AppRole
Assembly: OzonDomains
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/Authorization/AppRole.cs
Line coverage
83%
Covered lines: 10
Uncovered lines: 2
Coverable lines: 12
Total lines: 33
Line coverage: 83.3%
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_Id()100%11100%
get_Name()100%11100%
get_DisplayName()100%11100%
get_Description()100%210%
get_IsSystem()100%210%
get_IsActive()100%11100%
get_CreatedAt()100%11100%
get_UpdatedAt()100%11100%
get_PagePermissions()100%11100%
get_FieldPermissions()100%11100%
get_DataScopes()100%11100%
get_UserLinks()100%11100%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonDomains/Models/Authorization/AppRole.cs

#LineLine coverage
 1using System.ComponentModel.DataAnnotations;
 2
 3namespace OzonDomains.Models.Authorization;
 4
 5/// <summary>
 6/// Прикладная роль (надстройка над Identity). Содержит набор разрешений на страницы, поля и наборы данных.
 7/// </summary>
 8public class AppRole
 9{
 5310    public int Id { get; set; }
 11
 12    [Required, MaxLength(150)]
 21413    public string Name { get; set; } = string.Empty;
 14
 15    [Required, MaxLength(300)]
 14216    public string DisplayName { get; set; } = string.Empty;
 17
 18    [MaxLength(1000)]
 019    public string? Description { get; set; }
 20
 21    /// <summary>Системные роли нельзя удалить (SuperAdmin, User).</summary>
 022    public bool IsSystem { get; set; }
 23
 12624    public bool IsActive { get; set; } = true;
 25
 8926    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
 8927    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
 28
 8929    public virtual ICollection<RolePagePermission> PagePermissions { get; set; } = new List<RolePagePermission>();
 8930    public virtual ICollection<RoleFieldPermission> FieldPermissions { get; set; } = new List<RoleFieldPermission>();
 8931    public virtual ICollection<RoleDataScope> DataScopes { get; set; } = new List<RoleDataScope>();
 8932    public virtual ICollection<UserAppRole> UserLinks { get; set; } = new List<UserAppRole>();
 33}