@PreAuthorize("hasRole('" + StandardEntitlement.GROUP_UPDATE + "')")
@Override
public ProvisioningResult<GroupTO> update(final GroupPatch groupPatch, final boolean nullPriorityAsync) {
GroupTO groupTO = binder.getGroupTO(groupPatch.getKey());
Set<String> dynRealmsBefore = new HashSet<>(groupTO.getDynRealms());
Pair<GroupPatch, List<LogicActions>> before = beforeUpdate(groupPatch, groupTO.getRealm());
String realm =
before.getLeft().getRealm() != null && StringUtils.isNotBlank(before.getLeft().getRealm().getValue())
? before.getLeft().getRealm().getValue()
: groupTO.getRealm();
Set<String> effectiveRealms = RealmUtils.getEffective(
AuthContextUtils.getAuthorizations().get(StandardEntitlement.GROUP_UPDATE),
realm);
boolean authDynRealms = securityChecks(effectiveRealms, realm, before.getLeft().getKey());
Pair<GroupPatch, List<PropagationStatus>> updated =
provisioningManager.update(groupPatch, nullPriorityAsync);
return afterUpdate(
binder.getGroupTO(updated.getLeft().getKey()),
updated.getRight(),
before.getRight(),
authDynRealms,
dynRealmsBefore);
}