KEYCLOAK-2947: Include group representation for GroupMembership changes in AdminEvents
We now include the full group representation in AdminEvents for Group Membership changes. This enables EventListener to propagate potential role / attribute chnages based on the removal / addition of the group.
This commit is contained in:
1 parent
84d543b232
commit
a58595e210
1 file changed
+2
-3
@@ -959,7 +959,7 @@ public class UsersResource {
|
||||
try {
|
||||
if (user.isMemberOf(group)){
|
||||
user.leaveGroup(group);
|
||||
adminEvent.operation(OperationType.DELETE).resourcePath(uriInfo).success();
|
||||
adminEvent.operation(OperationType.DELETE).representation(ModelToRepresentation.toRepresentation(group, true)).resourcePath(uriInfo).success();
|
||||
}
|
||||
} catch (ModelException me) {
|
||||
Properties messages = AdminRoot.getMessages(session, realm, auth.getAuth().getToken().getLocale());
|
||||
@@ -984,9 +984,8 @@ public class UsersResource {
|
||||
}
|
||||
if (!user.isMemberOf(group)){
|
||||
user.joinGroup(group);
|
||||
adminEvent.operation(OperationType.CREATE).resourcePath(uriInfo).success();
|
||||
adminEvent.operation(OperationType.CREATE).representation(ModelToRepresentation.toRepresentation(group, true)).resourcePath(uriInfo).success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user