Skip to content

Commit

Permalink
applied new ui authorizations for Assign/Unassign menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jun 5, 2017
1 parent 7bc4b49 commit 4587e36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Expand Up @@ -209,9 +209,7 @@ protected List<InlineMenuItem> createAssignmentMenu() {
List<InlineMenuItem> items = new ArrayList<>();

InlineMenuItem item;
// TODO: the modify authorization here is probably wrong.
// It is a model autz. UI autz should be here instead?
if (WebComponentUtil.isAuthorized(ModelAuthorizationAction.ASSIGN.getUrl())) {
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.assign"),
new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
Expand Down Expand Up @@ -270,9 +268,7 @@ protected void assignSelectedOrgPerformed(List<OrgType> selectedOrgs,
items.add(item);
items.add(new InlineMenuItem());
}
// TODO: the modify authorization here is probably wrong.
// It is a model autz. UI autz should be here instead?
if (WebComponentUtil.isAuthorized(ModelAuthorizationAction.UNASSIGN.getUrl())) {
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_UNASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.unassign"),
new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
Expand Down
Expand Up @@ -139,9 +139,7 @@ protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.

@Override
public boolean isEnabled() {
// TODO: the modify authorization here is probably wrong.
// It is a model autz. UI autz should be here instead?
return WebComponentUtil.isAuthorized(ModelAuthorizationAction.UNASSIGN.getUrl());
return WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_UNASSIGN_ACTION_URI);
}
});

Expand Down
Expand Up @@ -131,9 +131,7 @@ protected void onSelectPerformed(AjaxRequestTarget target, UserType user) {
});
items.add(item);
}
// TODO: the modify authorization here is probably wrong.
// It is a model autz. UI autz should be here instead?
if (WebComponentUtil.isAuthorized(ModelAuthorizationAction.UNASSIGN.getUrl())) {
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_UNASSIGN_ACTION_URI)) {
item = new InlineMenuItem(createStringResource("AssignmentTablePanel.menu.deleteDelegation"),
new InlineMenuItemAction() {
private static final long serialVersionUID = 1L;
Expand Down

0 comments on commit 4587e36

Please sign in to comment.