Refactoring - Version stable
This commit is contained in:
@@ -101,7 +101,7 @@ public class AdminUserService {
|
||||
List<String> currentNames = getUserRoles(userId).stream()
|
||||
.map(RoleDTO::getName)
|
||||
.collect(Collectors.toList());
|
||||
List<String> toAssign = targetRoleNames == null ? List.of() : new ArrayList<>(targetRoleNames);
|
||||
List<String> toAssign = new ArrayList<>(targetRoleNames != null ? targetRoleNames : List.of());
|
||||
toAssign.removeAll(currentNames);
|
||||
List<String> toRevoke = new ArrayList<>(currentNames);
|
||||
toRevoke.removeAll(targetRoleNames == null ? List.of() : targetRoleNames);
|
||||
|
||||
Reference in New Issue
Block a user