From 78f5f317629ab74472e20f41b2113a2ca0e7c98c Mon Sep 17 00:00:00 2001 From: panda Date: Sun, 24 Mar 2024 13:41:00 +0800 Subject: [PATCH] core: fix contest manager can not view contest record code (#764) --- packages/hydrooj/src/handler/record.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/hydrooj/src/handler/record.ts b/packages/hydrooj/src/handler/record.ts index 5f96af17c..4750d29d9 100644 --- a/packages/hydrooj/src/handler/record.ts +++ b/packages/hydrooj/src/handler/record.ts @@ -188,6 +188,7 @@ class RecordDetailHandler extends ContestDetailBaseHandler { canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE_ACCEPT) && self?.status === STATUS.STATUS_ACCEPTED; if (this.tdoc) { const tsdoc = await contest.getStatus(domainId, this.tdoc.docId, this.user._id); + canViewCode ||= this.user.own(this.tdoc); if (this.tdoc.allowViewCode && contest.isDone(this.tdoc)) { canViewCode ||= tsdoc?.attend; }