core: fix contest manager can not view contest record code (#764)

This commit is contained in:
panda authored and GitHub committed 2024-03-24 13:41:00 +08:00
1 parent 1b394f7442
commit 78f5f31762
1 file changed
+1
+1
View File
@@ -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;
}