From d0f1e16126477062acfb01bfa7dbdfd3d0f59793 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Thu, 31 Oct 2024 11:12:39 +0000 Subject: [PATCH 1/2] add demoUser to api user auth --- api.planx.uk/modules/auth/middleware.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.planx.uk/modules/auth/middleware.ts b/api.planx.uk/modules/auth/middleware.ts index ef0335ff68..08c9a69e7a 100644 --- a/api.planx.uk/modules/auth/middleware.ts +++ b/api.planx.uk/modules/auth/middleware.ts @@ -219,10 +219,11 @@ export const useRoleAuth: UseRoleAuth = // Convenience methods for role-based access export const useTeamViewerAuth = useRoleAuth([ "teamViewer", + "demoUser", "teamEditor", "platformAdmin", ]); -export const useTeamEditorAuth = useRoleAuth(["teamEditor", "platformAdmin"]); +export const useTeamEditorAuth = useRoleAuth(["teamEditor", "platformAdmin", "demoUser"]); export const usePlatformAdminAuth = useRoleAuth(["platformAdmin"]); /** From 78d52c6a021eab00087e3d50ff4cd9eba35ddf25 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Thu, 31 Oct 2024 11:15:58 +0000 Subject: [PATCH 2/2] lint fix --- api.planx.uk/modules/auth/middleware.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api.planx.uk/modules/auth/middleware.ts b/api.planx.uk/modules/auth/middleware.ts index 08c9a69e7a..2443f0dace 100644 --- a/api.planx.uk/modules/auth/middleware.ts +++ b/api.planx.uk/modules/auth/middleware.ts @@ -223,7 +223,11 @@ export const useTeamViewerAuth = useRoleAuth([ "teamEditor", "platformAdmin", ]); -export const useTeamEditorAuth = useRoleAuth(["teamEditor", "platformAdmin", "demoUser"]); +export const useTeamEditorAuth = useRoleAuth([ + "teamEditor", + "platformAdmin", + "demoUser", +]); export const usePlatformAdminAuth = useRoleAuth(["platformAdmin"]); /**