Skip to content

Commit

Permalink
SHIBUI-2394
Browse files Browse the repository at this point in the history
Changes for 2440 odd behavior in fetch lists for action required screens
  • Loading branch information
chasegawa committed Oct 28, 2022
1 parent 0b8ccc8 commit ef7eb92
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ public EntityDescriptorRepresentation changeApproveStatusOfEntityDescriptor(Stri
if (status) { // approve
int approvedCount = ed.approvedCount();
List<Approvers> approversList = groupService.find(ed.getIdOfOwner()).getApproversList();
if (!approversList.isEmpty() && approversList.size() > approvedCount) {
Approvers approvers = approversList.get(
approvedCount); // yea for index zero - use the count to get the next approvers
if (approversList.isEmpty() && userService.currentUserIsAdmin()){
ed.setApproved(true);
ed = entityDescriptorRepository.save(ed);
} else if (!approversList.isEmpty() && approversList.size() > approvedCount) {
Approvers approvers = approversList.get(approvedCount); // yea for index zero - use the count to get the next approvers
if (!userService.currentUserCanApprove(approvers.getApproverGroups())) {
throw new ForbiddenException("You do not have the permissions necessary to approve this entity descriptor.");
}
Expand Down

0 comments on commit ef7eb92

Please sign in to comment.