Skip to content

Commit

Permalink
UIU-3294: Provide correct role-assignment permissions for endpoints w…
Browse files Browse the repository at this point in the history
…ithin withUserRoles HOC used with UserEdit. (#2821)

Refs UIU-3294.
  • Loading branch information
aidynoJ authored Dec 10, 2024
1 parent 4efa3f0 commit 506842b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* 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)
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand All @@ -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
},
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useAllRolesData/useAllRolesData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 506842b

Please sign in to comment.