Skip to content

Commit

Permalink
mid-7467 delete authorization check
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jan 31, 2022
1 parent 617f3f5 commit 4096489
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.evolveum.midpoint.gui.api.util.WebComponentUtil;

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

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

protected boolean isDeleteButtonVisible() {
return isEditingObject() && !isReadonly();
return isEditingObject() && !isReadonly() && isAuthorizedToDelete();
}

private boolean isAuthorizedToDelete() {
return getPageBase().isAuthorized(ModelAuthorizationAction.DELETE, getModelObject().getObject());
}

protected boolean isReadonly() {
Expand Down

0 comments on commit 4096489

Please sign in to comment.