Skip to content

Commit e942253

Browse files
committed
Allow Managers to download submissions
1 parent 59b6584 commit e942253

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/api/submission/submission.service.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ export class SubmissionService {
576576
let isReviewer = false;
577577
let isCopilot = false;
578578
let isSubmitter = false;
579+
let isManager = false;
579580
if (!isOwner && submission.challengeId && uid) {
580581
try {
581582
const resources =
@@ -612,7 +613,10 @@ export class SubmissionService {
612613
if (rn.includes('submitter')) {
613614
isSubmitter = true;
614615
}
615-
if (isReviewer && isCopilot && isSubmitter) {
616+
if (rn.includes('manager')) {
617+
isManager = true;
618+
}
619+
if (isReviewer && isCopilot && isSubmitter && isManager) {
616620
break;
617621
}
618622
}
@@ -624,7 +628,7 @@ export class SubmissionService {
624628
}
625629
}
626630

627-
let canDownload = isOwner || isReviewer || isCopilot;
631+
let canDownload = isOwner || isReviewer || isCopilot || isManager;
628632

629633
if (!canDownload && isSubmitter && submission.challengeId && uid) {
630634
try {
@@ -667,7 +671,7 @@ export class SubmissionService {
667671
if (!canDownload) {
668672
throw new ForbiddenException({
669673
message:
670-
'Only the submission owner, a challenge reviewer/copilot, or an admin can download the submission',
674+
'Only the submission owner, a challenge reviewer/copilot/manager, or an admin can download the submission',
671675
code: 'FORBIDDEN_SUBMISSION_DOWNLOAD',
672676
details: {
673677
submissionId,

0 commit comments

Comments
 (0)