core: disable view contest code by default

This commit is contained in:
undefined committed 2022-10-08 22:05:58 +08:00
1 parent eb6f1abc8b
commit 4b09a83ede
3 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -155,7 +155,7 @@ class RecordDetailHandler extends Handler {
canViewCode ||= this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE);
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE);
canViewCode ||= this.user.hasPerm(PERM.PERM_READ_RECORD_CODE_ACCEPT) && self?.status === STATUS.STATUS_ACCEPTED;
if (tdoc && contest.isDone(tdoc)) {
if (tdoc && tdoc.allowViewCode && contest.isDone(tdoc)) {
const tsdoc = await contest.getStatus(domainId, tdoc.docId, this.user._id);
canViewCode ||= tsdoc?.attend;
}