Skip to content

Commit

Permalink
Fix useGroups & update ssar check to patch
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewballantyne committed Dec 16, 2024
1 parent bcf15a2 commit b17a818
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frontend/src/api/k8s/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ export const useGroups = (): CustomWatchK8sResult<GroupKind[]> => {
const [groupData, loaded, error] = useK8sWatchResourceList<GroupKind[]>(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]);
};
2 changes: 1 addition & 1 deletion frontend/src/concepts/userConfigs/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof useAccessReview> =>
Expand Down

0 comments on commit b17a818

Please sign in to comment.