3ccfe521 by Adam Heath

Map UserAccount.disabled to User.setEnabled, instead of only basing it

on when a newPassword is available.
1 parent d8351e91
......@@ -165,7 +165,7 @@ Map<String, Object> syncUserAccount() {
}
String keycloakUserId = userAccount.externalUserId
logger.info("Would update: keycloak(${keycloakUserId})")
updateUser(keycloakUserId, userId, newPassword != null)
updateUser(keycloakUserId, userId)
if (newPassword != null) {
UserResource userResource = usersResource.get(keycloakUserId)
......@@ -397,7 +397,7 @@ Map<String, RoleRepresentation> getClientRoles(RealmResource realm, ClientResour
// return getKeycloakGroup(realm, "moqui:userGroup:${userGroup.userGroupId}", sync)
//}
void updateUser(String keycloakUserId, String userId, boolean enabled) {
void updateUser(String keycloakUserId, String userId) {
RealmResource realmResource = getKeycloakRealm()
String keycloakClientId = getKeycloakClientId()
......@@ -455,9 +455,7 @@ void updateUser(String keycloakUserId, String userId, boolean enabled) {
RoleScopeResource clientRoleScopeResource = roleMappingResource.clientLevel(keycloakClientId)
clientRoleScopeResource.remove(toRemove)
clientRoleScopeResource.add(toAdd)
if (enabled) {
userRep.setEnabled(true)
}
userRep.setEnabled("N".equals(userAccount.disabled))
userResource.update(userRep)
Map<String, Object> foo = userResource.impersonate()
......