Skip to content

Commit

Permalink
request access wizard: take into account systemConfiguration/roleMana…
Browse files Browse the repository at this point in the history
…gement/defaultExecuteAfterAllApprovals when submitting new request
  • Loading branch information
1azyman committed Feb 19, 2024
1 parent 43f7680 commit 61e6e35
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,8 @@ private OperationResult submitMultiRequest(PageBase page) {

ModelExecuteOptions options = createSubmitModelOptions(page.getPrismContext());
options.initialPartialProcessing(new PartialProcessingOptionsType().inbound(SKIP).projection(SKIP));
boolean executeImmediately = isDefaultExecuteAfterAllApprovals(page);
options.executeImmediatelyAfterApproval(executeImmediately);
request.setExecutionOptions(options.toModelExecutionOptionsType());

PrismObject<UserType> user = WebModelServiceUtils.loadObject(poiRef, page);
Expand Down Expand Up @@ -970,6 +972,16 @@ private RelationSelectionType getRelationConfiguration(Page page) {
return relation != null ? relation : new RelationSelectionType();
}

private Boolean isDefaultExecuteAfterAllApprovals(Page page) {
SystemConfigurationType config = MidPointApplication.get().getSystemConfigurationIfAvailable();
if (config == null || config.getRoleManagement() == null) {
return null;
}

RoleManagementConfigurationType roleManagement = config.getRoleManagement();
return roleManagement.isDefaultExecuteAfterAllApprovals();
}

public AccessRequestType getAccessRequestConfiguration(Page page) {
CompiledGuiProfile profile = WebComponentUtil.getCompiledGuiProfile(page);
if (profile == null) {
Expand Down

0 comments on commit 61e6e35

Please sign in to comment.