Skip to content

Commit

Permalink
SHIBUI-2394
Browse files Browse the repository at this point in the history
Adding User "canApprove" to json for the UI
  • Loading branch information
chasegawa committed Oct 18, 2022
1 parent 37156e5 commit c17c531
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,19 @@ public void setGroups(Set<Group> groups) {
public void registerLoader(ILazyLoaderHelper lazyLoaderHelper) {
this.lazyLoaderHelper = lazyLoaderHelper;
}

/**
* @return true if the user belongs to any group that can approve for other groups
*/
public boolean getCanApprove() {
if (Group.ADMIN_GROUP.equals(getGroup())) {
return true;
}
for (Group group : getUserGroups()) {
if (!group.getApproveForList().isEmpty()) {
return true;
}
}
return false;
}
}

0 comments on commit c17c531

Please sign in to comment.