Skip to content

Commit

Permalink
MK-1208 Status transitions are in accordance with permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Dec 19, 2016
1 parent 1b095d6 commit 88897fb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ public void checkStatusTransition(DataAccessRequest request, DataAccessRequest.S
*/
public Iterable<DataAccessRequest.Status> nextStatus(DataAccessRequest request) {
List<DataAccessRequest.Status> to = Lists.newArrayList();
if (!subjectAclService.isPermitted("/data-access-request/" + request.getId(), "EDIT", "_status")) return to;
switch(request.getStatus()) {
case OPENED:
if (subjectAclService.isCurrentUser(request.getApplicant())) addNextOpenedStatus(to);
addNextOpenedStatus(to);
break;
case SUBMITTED:
addNextSubmittedStatus(to);
Expand All @@ -100,7 +101,7 @@ public Iterable<DataAccessRequest.Status> nextStatus(DataAccessRequest request)
addNextReviewedStatus(to);
break;
case CONDITIONALLY_APPROVED:
if (subjectAclService.isCurrentUser(request.getApplicant())) addNextConditionallyApprovedStatus(to);
addNextConditionallyApprovedStatus(to);
break;
case APPROVED:
addNextApprovedStatus(to);
Expand Down

0 comments on commit 88897fb

Please sign in to comment.