From c830005a8b451aaa625fc92b1a325cb0598a05d4 Mon Sep 17 00:00:00 2001 From: BearHanded Date: Tue, 13 Aug 2024 10:29:32 -0400 Subject: [PATCH] remove dash in idm role name --- services/ui-auth/libs/users.json | 26 +++++++++---------- services/ui-src/src/types/users.ts | 10 +++---- .../ui-src/src/utils/auth/UserProvider.tsx | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/services/ui-auth/libs/users.json b/services/ui-auth/libs/users.json index 0194cdb9..f68206af 100644 --- a/services/ui-auth/libs/users.json +++ b/services/ui-auth/libs/users.json @@ -20,7 +20,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-bor" + "Value": "mdcthcbs-bor" } ] }, @@ -46,7 +46,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-bor" + "Value": "mdcthcbs-bor" } ] }, @@ -71,7 +71,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-hd" + "Value": "mdcthcbs-hd" } ] }, @@ -96,7 +96,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-internal-user" + "Value": "mdcthcbs-internal-user" } ] }, @@ -121,7 +121,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-user" + "Value": "mdcthcbs-state-user" }, { "Name": "custom:cms_state", @@ -150,7 +150,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-rep" + "Value": "mdcthcbs-state-rep" }, { "Name": "custom:cms_state", @@ -179,7 +179,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-appr" + "Value": "mdcthcbs-appr" }, { "Name": "custom:cms_state", @@ -208,7 +208,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-user" + "Value": "mdcthcbs-state-user" }, { "Name": "custom:cms_state", @@ -237,7 +237,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-user" + "Value": "mdcthcbs-state-user" }, { "Name": "custom:cms_state", @@ -266,7 +266,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-user" + "Value": "mdcthcbs-state-user" }, { "Name": "custom:cms_state", @@ -295,7 +295,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-user" + "Value": "mdcthcbs-state-user" }, { "Name": "custom:cms_state", @@ -324,7 +324,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-bor" + "Value": "mdcthcbs-bor" } ] }, @@ -349,7 +349,7 @@ }, { "Name": "custom:cms_roles", - "Value": "mdct-hcbs-state-user" + "Value": "mdcthcbs-state-user" }, { "Name": "custom:cms_state", diff --git a/services/ui-src/src/types/users.ts b/services/ui-src/src/types/users.ts index d51f6940..493d1eb9 100644 --- a/services/ui-src/src/types/users.ts +++ b/services/ui-src/src/types/users.ts @@ -2,11 +2,11 @@ // TODO: Finalize with IDM export enum UserRoles { - ADMIN = "mdct-hcbs-bor", // "MDCT HCBS Business Owner Representative" - APPROVER = "mdct-hcbs-appr", // "MDCT HCBS Approver" - HELP_DESK = "mdct-hcbs-hd", // "MDCT HCBS Help Desk" - INTERNAL = "mdct-hcbs-internal-user", // "MDCT HCBS Internal User" - STATE_USER = "mdct-hcbs-state-user", // "MDCT HCBS State User" + ADMIN = "mdcthcbs-bor", // "MDCT HCBS Business Owner Representative" + APPROVER = "mdcthcbs-appr", // "MDCT HCBS Approver" + HELP_DESK = "mdcthcbs-hd", // "MDCT HCBS Help Desk" + INTERNAL = "mdcthcbs-internal-user", // "MDCT HCBS Internal User" + STATE_USER = "mdcthcbs-state-user", // "MDCT HCBS State User" } export interface HcbsUser { diff --git a/services/ui-src/src/utils/auth/UserProvider.tsx b/services/ui-src/src/utils/auth/UserProvider.tsx index 42de66c7..7c3b4932 100644 --- a/services/ui-src/src/utils/auth/UserProvider.tsx +++ b/services/ui-src/src/utils/auth/UserProvider.tsx @@ -71,7 +71,7 @@ export const UserProvider = ({ children }: Props) => { const { email, given_name, family_name } = payload; // "custom:cms_roles" is an string of concat roles so we need to check for the one applicable to HCBS const cms_role = payload["custom:cms_roles"] as string; - const userRole = cms_role.split(",").find((r) => r.includes("mdct-hcbs")); + const userRole = cms_role.split(",").find((r) => r.includes("mdcthcbs")); const state = payload["custom:cms_state"] as string | undefined; const full_name = [given_name, " ", family_name].join(""); const userCheck = {