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:
parent
f58936025f
commit
5f73c338d8
1 changed files with 2 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue