diff options
| author | ivar <i@oiee.no> | 2024-03-19 01:02:22 +0100 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2024-03-19 01:02:22 +0100 |
| commit | 5f604b3052dab1d51dc130df2470bf330b283ec6 (patch) | |
| tree | ae00e1fe4542850467555b4e3af41964ba8d878b /code/api/Models/LoggedInUserModel.cs | |
| parent | 63cf177e8cf22e349534664d59a6926f8b36863d (diff) | |
| download | storage-5f604b3052dab1d51dc130df2470bf330b283ec6.tar.xz storage-5f604b3052dab1d51dc130df2470bf330b283ec6.zip | |
Max lenghts on db schema
Use latest temporal from cdn
Implement majority of translation functionality
Major refinements/bugs
Diffstat (limited to 'code/api/Models/LoggedInUserModel.cs')
| -rw-r--r-- | code/api/Models/LoggedInUserModel.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/code/api/Models/LoggedInUserModel.cs b/code/api/Models/LoggedInUserModel.cs index 9d9b944..46cea50 100644 --- a/code/api/Models/LoggedInUserModel.cs +++ b/code/api/Models/LoggedInUserModel.cs @@ -1,4 +1,4 @@ -namespace I2R.Storage.Api.Models; +namespace Quality.Storage.Api.Models; public class LoggedInUserModel { @@ -7,12 +7,12 @@ public class LoggedInUserModel public LoggedInUserModel(ClaimsPrincipal user) { Username = user.FindFirstValue(AppClaims.USERNAME); Id = user.FindFirstValue(AppClaims.USER_ID).AsGuid(); - Role = UserRole.FromString(user.FindFirstValue(AppClaims.USER_ROLE)); + Role = UserRoleHelper.FromString(user.FindFirstValue(AppClaims.USER_ROLE)); } public string Username { get; set; } public Guid Id { get; set; } - public EUserRole Role { get; set; } + public UserRole Role { get; set; } public class Public { @@ -22,7 +22,7 @@ public class LoggedInUserModel } public static Public ForThePeople(HttpContext httpContext) { - return new Public() { + return new Public { Id = httpContext.User.FindFirstValue(AppClaims.USER_ID), Username = httpContext.User.FindFirstValue(AppClaims.USERNAME), Role = httpContext.User.FindFirstValue(AppClaims.USER_ROLE) |
