From 5c25c4d9edcd4d18da713a425f67f25355aa29b0 Mon Sep 17 00:00:00 2001 From: aidynoJ <121284650+aidynoJ@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:57:24 +0500 Subject: [PATCH] UIU-3294: Provide correct role-assignment permissions for endpoints within withUserRoles HOC used with UserEdit. (#2821) Refs UIU-3294. --- CHANGELOG.md | 3 ++- package.json | 9 +++++++-- src/hooks/useAllRolesData/useAllRolesData.js | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f564480f..d32121563 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ * Add permission to access users-keycloak delete method. Refs UIU-3282. * Fix issue with `Proxy borrower` field value. Refs UIU-3290. * Check if userId is present in withUserRoles HOC. Refs UIU-3273. - +* Add missed `circulation-storage.loans.item.get`, `inventory.items.item.get` permissions. Refs UIU-3291. +* Add missed permissions for endpoints used in withUserRoles HOC. UIU-3294. ## [11.0.7](https://github.com/folio-org/ui-users/tree/v11.0.7) (2024-11-30) diff --git a/package.json b/package.json index 8aca88246..fa1996616 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,10 @@ "user-settings.custom-fields.item.stats.get", "departments.collection.get", "departments.item.get", - "users.configurations.item.get" + "users.configurations.item.get", + "roles.users.collection.get", + "users-keycloak.auth-users.item.get", + "roles.collection.get" ], "visible": true }, @@ -102,7 +105,9 @@ "tags.collection.get", "tags.item.post", "circulation-storage.request-preferences.item.post", - "circulation-storage.request-preferences.item.put" + "circulation-storage.request-preferences.item.put", + "roles.users.item.put", + "users-keycloak.auth-users.item.post" ], "visible": true }, diff --git a/src/hooks/useAllRolesData/useAllRolesData.js b/src/hooks/useAllRolesData/useAllRolesData.js index 53d75d918..542a07077 100644 --- a/src/hooks/useAllRolesData/useAllRolesData.js +++ b/src/hooks/useAllRolesData/useAllRolesData.js @@ -20,8 +20,8 @@ function useAllRolesData() { const [namespace] = useNamespace(); const { data, isLoading, isSuccess } = useQuery([namespace, 'user-roles'], () => { - return stripes.hasInterface('roles') && ky.get(`roles?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby name`).json(); - }); + return ky.get(`roles?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby name`).json(); + }, { enabled: stripes.hasInterface('roles') }); const allRolesMapStructure = useMemo(() => { const rolesMap = new Map();