gaseous-server/gaseous-lib/Classes/Auth/Models/UserViewModel.cs
Michael Green 9aa6be0494
Move background processes out of process (#693)
Introduce the gaseous library and process host projects, enabling out-of-process execution and enhancing task management. Implemented versioning support for AgeGroupMap downloads and improved status reporting for background tasks. Refactored various components for better integration and error handling. Updated configurations for inter-process communication and task initialization.
2026-02-22 21:20:31 +11:00

57 lines
No EOL
2 KiB
C#

namespace Authentication
{
public class UserViewModel
{
public string Id { get; set; }
public string UserName { get; set; }
public string EmailAddress { get; set; }
public bool LockoutEnabled { get; set; }
public DateTimeOffset? LockoutEnd { get; set; }
public List<string> Roles { get; set; }
public SecurityProfileViewModel SecurityProfile { get; set; }
public Guid ProfileId { get; set; }
public string HighestRole
{
get
{
string _highestRole = "";
if (Roles != null)
{
foreach (string role in Roles)
{
switch (role)
{
case "Admin":
// there is no higher
_highestRole = role;
break;
case "Gamer":
// only one high is Admin, so check for that
if (_highestRole != "Admin")
{
_highestRole = role;
}
break;
case "Player":
// make sure _highestRole isn't already set to Gamer or Admin
if (_highestRole != "Admin" && _highestRole != "Gamer")
{
_highestRole = role;
}
break;
default:
_highestRole = "Player";
break;
}
}
}
else
{
_highestRole = "Player";
}
return _highestRole;
}
}
}
}