mirror of
https://github.com/gaseous-project/gaseous-server
synced 2026-04-21 13:27:16 +00:00
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.
57 lines
No EOL
2 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
} |