From b17a818785c9ee172db7b7c81226b74ed3d6e21d Mon Sep 17 00:00:00 2001 From: Andrew Ballantyne Date: Mon, 16 Dec 2024 12:51:51 -0500 Subject: [PATCH] Fix useGroups & update ssar check to patch --- frontend/src/api/k8s/groups.ts | 5 ++++- frontend/src/concepts/userConfigs/utils.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/k8s/groups.ts b/frontend/src/api/k8s/groups.ts index 33a3909478..510062a89c 100644 --- a/frontend/src/api/k8s/groups.ts +++ b/frontend/src/api/k8s/groups.ts @@ -26,9 +26,12 @@ export const useGroups = (): CustomWatchK8sResult => { const [groupData, loaded, error] = useK8sWatchResourceList(initResource, GroupModel); return React.useMemo(() => { + if (!accessReviewLoaded) { + return [[], false, undefined]; + } if (!allowList) { return [[], true, undefined]; } return [groupData, loaded, error]; - }, [error, groupData, loaded, allowList]); + }, [accessReviewLoaded, allowList, groupData, loaded, error]); }; diff --git a/frontend/src/concepts/userConfigs/utils.ts b/frontend/src/concepts/userConfigs/utils.ts index 89462b0117..0de6a46f51 100644 --- a/frontend/src/concepts/userConfigs/utils.ts +++ b/frontend/src/concepts/userConfigs/utils.ts @@ -6,7 +6,7 @@ const authCheck: AccessReviewResourceAttributes = { group: 'services.platform.opendatahub.io', resource: AuthModel.plural, name: AUTH_SINGLETON_NAME, - verb: 'update', // If they can get the data but not updated, we can assume they cannot access it + verb: 'patch', // If they can get the data but not update it, we can assume they cannot access it }; export const useDoesUserHaveAuthAccess = (): ReturnType =>