@Override
public ProvisioningResult<AnyObjectTO> update(
final AnyObjectPatch anyObjectPatch, final boolean nullPriorityAsync) {
AnyObjectTO anyObjectTO = binder.getAnyObjectTO(anyObjectPatch.getKey());
Set<String> dynRealmsBefore = new HashSet<>(anyObjectTO.getDynRealms());
Pair<AnyObjectPatch, List<LogicActions>> before = beforeUpdate(anyObjectPatch, anyObjectTO.getRealm());
String realm =
before.getLeft().getRealm() != null && StringUtils.isNotBlank(before.getLeft().getRealm().getValue())
? before.getLeft().getRealm().getValue()
: anyObjectTO.getRealm();
Set<String> effectiveRealms = RealmUtils.getEffective(
AuthContextUtils.getAuthorizations().get(AnyEntitlement.UPDATE.getFor(anyObjectTO.getType())),
realm);
boolean authDynRealms = securityChecks(effectiveRealms, realm, before.getLeft().getKey());
Pair<AnyObjectPatch, List<PropagationStatus>> updated =
provisioningManager.update(anyObjectPatch, nullPriorityAsync);
return afterUpdate(
binder.getAnyObjectTO(updated.getLeft().getKey()),
updated.getRight(),
before.getRight(),
authDynRealms,
dynRealmsBefore);
}