Skip to content

Commit

Permalink
UIU-3243: Fix user edit without Auth-Users by adding users-keycloak.i…
Browse files Browse the repository at this point in the history
…tem.get to ui-users.edit subPermissions. (#2782)

Refs UIU-3243.

(cherry picked from commit 2f711ee)
  • Loading branch information
aidynoJ authored and zburke committed Nov 8, 2024
1 parent 966644b commit b1b6d82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* If keycloak user record doesn't exist, create it before resetting password. Refs UIU-3236.
* Conditionally use delete method of the `mod-users-keycloak` if `users-keycloak` interface is present in UserRecordContainer. Refs UIU-3234.
* Fix user edit without "Auth-Users" capability sets. Refs UIU-3243.

## [11.0.1](https://github.com/folio-org/ui-users/tree/v11.1.0) (2024-11-08)
[Full Changelog](https://github.com/folio-org/ui-users/compare/v11.0.0...v11.0.1)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"ui-users.view",
"users-bl.item.put",
"users.item.put",
"users-keycloak.item.get",
"users-keycloak.item.put",
"tags.collection.get",
"tags.item.post",
Expand Down
10 changes: 5 additions & 5 deletions src/components/Wrappers/withUserRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const withUserRoles = (WrappedComponent) => (props) => {

useEffect(() => {
// eslint-disable-next-line react/prop-types
if (props.stripes.hasInterface('roles') && !isAllRolesDataLoading) {
if (props.stripes.hasInterface('users-keycloak') && !isAllRolesDataLoading) {
api.get(
'roles/users', { searchParams },
)
Expand Down Expand Up @@ -86,15 +86,15 @@ const withUserRoles = (WrappedComponent) => (props) => {
};

const handleKeycloakUserExists = async (onFinish) => {
if (isEqual(assignedRoleIds, initialAssignedRoleIds)) {
onFinish();
return;
}
await updateUserRoles(assignedRoleIds);
onFinish();
};

const checkAndHandleKeycloakAuthUser = async (onFinish) => {
if (isEqual(assignedRoleIds, initialAssignedRoleIds)) {
onFinish();
return;
}
const userKeycloakStatus = await checkUserInKeycloak();
switch (userKeycloakStatus) {
case KEYCLOAK_USER_EXISTANCE.exist:
Expand Down
2 changes: 1 addition & 1 deletion src/views/UserEdit/UserEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class UserEdit extends React.Component {
try {
await mutator.selUser.PUT(data);

if (!stripes.hasInterface('roles')) {
if (!stripes.hasInterface('users-keycloak')) {
this.onCompleteEdit();
return;
}
Expand Down

0 comments on commit b1b6d82

Please sign in to comment.