diff options
Diffstat (limited to 'code/api/Enums')
| -rw-r--r-- | code/api/Enums/EUserRole.cs | 22 | ||||
| -rw-r--r-- | code/api/Enums/UserRole.cs | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/code/api/Enums/EUserRole.cs b/code/api/Enums/EUserRole.cs deleted file mode 100644 index 75a81b3..0000000 --- a/code/api/Enums/EUserRole.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace I2R.Storage.Api.Enums; - -public enum EUserRole -{ - LEAST_PRIVILEGED = 0, - ADMIN = 1, -} - -public static class UserRole -{ - public static EUserRole FromString(string role) => role switch { - "least_privileged" => EUserRole.LEAST_PRIVILEGED, - "admin" => EUserRole.ADMIN, - _ => throw new ArgumentOutOfRangeException(nameof(role), role, null) - }; - - public static string ToString(EUserRole role) => role switch { - EUserRole.LEAST_PRIVILEGED => "least_privileged", - EUserRole.ADMIN => "admin", - _ => throw new ArgumentOutOfRangeException(nameof(role), role, null) - }; -}
\ No newline at end of file diff --git a/code/api/Enums/UserRole.cs b/code/api/Enums/UserRole.cs new file mode 100644 index 0000000..86924b4 --- /dev/null +++ b/code/api/Enums/UserRole.cs @@ -0,0 +1,22 @@ +namespace Quality.Storage.Api.Enums; + +public enum UserRole +{ + LEAST_PRIVILEGED = 0, + ADMIN = 1, +} + +public static class UserRoleHelper +{ + public static UserRole FromString(string role) => role switch { + "least_privileged" => UserRole.LEAST_PRIVILEGED, + "admin" => UserRole.ADMIN, + _ => throw new ArgumentOutOfRangeException(nameof(role), role, null) + }; + + public static string ToString(UserRole role) => role switch { + UserRole.LEAST_PRIVILEGED => "least_privileged", + UserRole.ADMIN => "admin", + _ => throw new ArgumentOutOfRangeException(nameof(role), role, null) + }; +} |
