MINOR - Fix user update roles (#20014)

This commit is contained in:
Pere Miquel Brull 2025-03-03 10:03:22 +01:00 committed by GitHub
parent a3d7cee6ea
commit a6fa899cbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -648,8 +648,8 @@ public class UserRepository extends EntityRepository<User> {
deleteFrom(original.getId(), USER, Relationship.HAS, Entity.ROLE);
assignRoles(updated, updated.getRoles());
List<EntityReference> origRoles = listOrEmpty(original.getRoles());
List<EntityReference> updatedRoles = listOrEmpty(updated.getRoles());
List<EntityReference> origRoles = listOrEmptyMutable(original.getRoles());
List<EntityReference> updatedRoles = listOrEmptyMutable(updated.getRoles());
origRoles.sort(EntityUtil.compareEntityReference);
updatedRoles.sort(EntityUtil.compareEntityReference);