Skip to content

Commit

Permalink
mid-7467 edit raw authorization check
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jan 31, 2022
1 parent 11235d9 commit b42eab4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;

import com.evolveum.midpoint.model.api.ModelAuthorizationAction;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel;

import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -101,7 +102,12 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
}

protected boolean isEditRawButtonVisible() {
return isEditingObject() && !isReadonly();
return isEditingObject() && !isReadonly() && isDebugPageAuthorized();
}

private boolean isDebugPageAuthorized() {
return WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_CONFIGURATION_URL,
AuthorizationConstants.AUTZ_UI_CONFIGURATION_DEBUGS_URL, AuthorizationConstants.AUTZ_UI_CONFIGURATION_DEBUG_URL);
}

private void createBackButton(RepeatingView repeatingView) {
Expand Down

0 comments on commit b42eab4

Please sign in to comment.