2026-12-02 00:20:49 +01:00
|
|
|
namespace Helpdesk.Web.Auth;
|
|
|
|
|
|
|
|
|
|
/// <summary>Kódy rolí z API (claim <c>role</c>) a jejich české názvy pro rozhraní.</summary>
|
|
|
|
|
public static class UserRoles
|
|
|
|
|
{
|
|
|
|
|
public const string Student = "STUDENT";
|
|
|
|
|
public const string Teacher = "TEACHER";
|
|
|
|
|
public const string FacilityManager = "FACILITY_MANAGER";
|
|
|
|
|
public const string Management = "MANAGEMENT";
|
|
|
|
|
public const string Admin = "ADMIN";
|
|
|
|
|
|
2026-12-04 16:49:05 +01:00
|
|
|
public static IReadOnlyList<string> All { get; } = [Student, Teacher, FacilityManager, Management, Admin];
|
|
|
|
|
|
2026-12-02 00:20:49 +01:00
|
|
|
public static string DisplayName(string? role) => role switch
|
|
|
|
|
{
|
|
|
|
|
Student => "Student",
|
|
|
|
|
Teacher => "Vyučující",
|
|
|
|
|
FacilityManager => "Správce budov",
|
|
|
|
|
Management => "Vedení školy",
|
|
|
|
|
Admin => "Administrátor",
|
|
|
|
|
_ => "Uživatel",
|
|
|
|
|
};
|
|
|
|
|
}
|