Skip to content

Commit

Permalink
fix for saving any object
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Aug 29, 2023
1 parent e1795fe commit 6e8756c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,15 @@ public Collection<ObjectDeltaOperation<? extends ObjectType>> saveOrPreviewPerfo

LOGGER.trace("returning from saveOrPreviewPerformed");


Collection<ObjectDeltaOperation<? extends ObjectType>> executedDeltas;
BusinessRoleApplicationDto patternDeltas = ((AbstractRoleDetailsModel) getObjectDetailsModels()).getPatternDeltas();
//TODO this isn't good place? It's not safe to just cast to any model, there might be others, like UserDetailsModel etc.
//if it's only related to roles, think about moving it to the role details page or so.
BusinessRoleApplicationDto patternDeltas = null;
if (getObjectDetailsModels() instanceof AbstractRoleDetailsModel abstractRoleDetailsModel) {
patternDeltas = abstractRoleDetailsModel.getPatternDeltas();
}

if (patternDeltas != null && !patternDeltas.getBusinessRoleDtos().isEmpty()) {
ModelService modelService = ((PageBase) getPage()).getModelService();
executedDeltas = new ObjectChangesExecutorImpl()
Expand Down

0 comments on commit 6e8756c

Please sign in to comment.