Skip to content

Commit

Permalink
SAM-2570 500 error for anonymous quiz results
Browse files Browse the repository at this point in the history
  • Loading branch information
smarquard authored and ottenhoff committed Jun 10, 2015
1 parent 25bb75d commit d56c9f2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public void processAction(ActionEvent ae) throws

int action = delivery.getActionMode();
PublishedAssessmentFacade pub = getPublishedAssessmentBasedOnAction(action, delivery, assessmentId, publishedId);

AssessmentAccessControlIfc control = pub.getAssessmentAccessControl();
boolean releaseToAnonymous = control.getReleaseTo() != null && control.getReleaseTo().indexOf("Anonymous Users")> -1;

if(pub == null){
delivery.setOutcome("poolUpdateError");
throw new AbortProcessingException("pub is null");
Expand All @@ -143,7 +147,7 @@ public void processAction(ActionEvent ae) throws
}
}
else if (DeliveryBean.REVIEW_ASSESSMENT == action || DeliveryBean.TAKE_ASSESSMENT == action) {
if (!authzBean.isUserAllowedToTakeAssessment(pub.getPublishedAssessmentId().toString())) {
if (!releaseToAnonymous && !authzBean.isUserAllowedToTakeAssessment(pub.getPublishedAssessmentId().toString())) {
throw new IllegalArgumentException("User does not have permission to view assessment id " + pub.getPublishedAssessmentId());
}
}
Expand Down

0 comments on commit d56c9f2

Please sign in to comment.