From 5f604b3052dab1d51dc130df2470bf330b283ec6 Mon Sep 17 00:00:00 2001 From: ivar Date: Tue, 19 Mar 2024 01:02:22 +0100 Subject: Max lenghts on db schema Use latest temporal from cdn Implement majority of translation functionality Major refinements/bugs --- code/api/Enums/EUserRole.cs | 22 ---------------------- code/api/Enums/UserRole.cs | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 code/api/Enums/EUserRole.cs create mode 100644 code/api/Enums/UserRole.cs (limited to 'code/api/Enums') 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) + }; +} -- cgit v1.3