diff --git a/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java b/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java index 4fffac9fe..08313fa4f 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java +++ b/dmp-backend/core/src/main/java/eu/eudat/service/user/UserServiceImpl.java @@ -217,7 +217,7 @@ public class UserServiceImpl implements UserService { item.setRole(roleName); item.setCreatedAt(Instant.now()); this.entityManager.persist(item); - this.keycloakService.assignClientRoleToUser(data.getId(), null, KeycloakRole.valueOf(roleName)); + this.keycloakService.addUserToGroup(data.getId(), KeycloakRole.valueOf(roleName)); } foundIds.add(item.getId()); } @@ -225,7 +225,7 @@ public class UserServiceImpl implements UserService { this.entityManager.flush(); List toDelete = existingItems.stream().filter(x-> foundIds.stream().noneMatch(y-> y.equals(x.getId()))).collect(Collectors.toList()); - toDelete.forEach(x -> this.keycloakService.removeClientRoleFromUser(data.getId(), null, KeycloakRole.valueOf(x.getRole()))); + toDelete.forEach(x -> this.keycloakService.removeUserFromGroup(data.getId(), KeycloakRole.valueOf(x.getRole()))); this.deleterFactory.deleter(UserRoleDeleter.class).deleteAndSave(toDelete); this.entityManager.flush();