Skip to content

Commit

Permalink
SAK-40330 Assignment Allow TA with grade to update submission (sakaip…
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored Jun 10, 2021
1 parent f6180cf commit 18fda3d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,10 @@ public void updateSubmission(AssignmentSubmission submission) throws PermissionE
Assert.notNull(submission.getId(), "Submission doesn't appear to have been persisted yet");

String reference = AssignmentReferenceReckoner.reckoner().submission(submission).reckon().getReference();
if (!allowUpdateSubmission(reference)) {
String assignmentReference = AssignmentReferenceReckoner.reckoner().assignment(submission.getAssignment()).reckon().getReference();

// TODO these permissions checks should coincide with the changes that are being made for the submission
if (!(allowUpdateSubmission(reference) || allowGradeSubmission(assignmentReference))) {
throw new PermissionException(sessionManager.getCurrentSessionUserId(), SECURE_UPDATE_ASSIGNMENT_SUBMISSION, null);
}
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_SUBMISSION, reference, true));
Expand Down

0 comments on commit 18fda3d

Please sign in to comment.