using Galaeth.Core.Constants;
namespace Galaeth.Core.Extensions;
///
/// extensions.
///
public static class UserRoleExtensions
{
///
/// Return a collection of roles a role is entitled to.
///
/// The role to query.
/// A collection of roles the role is entitled to.
public static UserRole[] UserRoleEntitlement(this UserRole role)
{
switch (role)
{
default:
case UserRole.Normal:
return
[UserRole.Normal];
case UserRole.Moderator:
return
[UserRole.Normal, UserRole.Moderator];
case UserRole.Root:
return
[UserRole.Normal, UserRole.Moderator, UserRole.Root];
}
}
}