Skip to content

Commit

Permalink
MID-9380 isAuthorized method usage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jan 24, 2024
1 parent ed830a7 commit c64f675
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ protected boolean isSaveButtonVisible() {
protected boolean isAuthorizedToModify() {
try {
return getPageBase().isAuthorized(ModelAuthorizationAction.MODIFY.getUrl(),
AuthorizationPhaseType.EXECUTION, getModelObject().getObject(), null, null);
AuthorizationPhaseType.EXECUTION, getModelObject().getObject(), null, null, null);
} catch (Exception e) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ public UserOperationalButtonsPanel(String id, LoadableModel<PrismObjectWrapper<U
protected boolean isAuthorizedToModify() {
try {
boolean thisObjectModify = super.isAuthorizedToModify();

UserType user = new UserType();
getPageBase().getPrismContext().adopt(user);
boolean otherUserModify = getPageBase().isAuthorized(ModelAuthorizationAction.MODIFY.getUrl(),
AuthorizationPhaseType.EXECUTION, new UserType().asPrismObject(), null, null);
AuthorizationPhaseType.EXECUTION, user.asPrismObject(), null, null, null);
return thisObjectModify || otherUserModify;
} catch (Exception e) {
return false;
Expand Down

0 comments on commit c64f675

Please sign in to comment.