Skip to content

Commit

Permalink
process also shadow modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Sep 28, 2021
1 parent 225614c commit 71a14c9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,11 @@ protected Collection<ObjectDeltaOperation<? extends ObjectType>> executeChanges(

//TODO this is just a quick hack.. for focus objects, feedback panel and results are processed by ProgressAware.finishProcessing()

Collection<ObjectDeltaOperation<? extends ObjectType>> executedDeltas = getChangeExecutor().executeChanges(deltas, previewOnly, task, result, target);
ObjectChangeExecutor changeExecutor = getChangeExecutor();
Collection<ObjectDeltaOperation<? extends ObjectType>> executedDeltas = changeExecutor.executeChanges(deltas, previewOnly, task, result, target);

result.computeStatusIfUnknown();
if (getChangeExecutor() instanceof ObjectChangesExecutorImpl) {
if (changeExecutor instanceof ObjectChangesExecutorImpl) {
showResult(result);
if (!previewOnly && result.isSuccess()) {
redirectBack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,41 @@ private boolean skipDeleteShadow(ObjectReferenceType resourceRef, List<ShadowWra
}
return false;
}

@Override
protected List<ObjectDelta<? extends ObjectType>> getAdditionalModifyDeltas(OperationResult result) {
List<ObjectDelta<? extends ObjectType>> deltas = new ArrayList<>();

List<ShadowWrapper> accounts = projectionModel.getObject();
for (ShadowWrapper account : accounts) {
try {
ObjectDelta<ShadowType> delta = account.getObjectDelta();
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Account delta computed from {} as:\n{}",
account, delta.debugDump(3));
}

if (!UserDtoStatus.MODIFY.equals(account.getProjectionStatus())) {
continue;
}

if (delta == null || delta.isEmpty()) {
continue;
}

WebComponentUtil.encryptCredentials(delta, true, getPageBase());
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Modifying account:\n{}", delta.debugDump(3));
}

deltas.add(delta);

} catch (Exception ex) {
result.recordFatalError(getPageBase().getString("PageAdminFocus.message.getShadowModifyDeltas.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't compute account delta", ex);
}
}

return deltas;
}
}

0 comments on commit 71a14c9

Please sign in to comment.