core: limit access for hidden problems' submission

This commit is contained in:
undefined committed 2021-08-07 03:41:25 +08:00
1 parent 77fc46c069
commit 738d622225
14 files changed
+52 -53

No files matched your search

+2 -2
View File
@@ -388,8 +388,8 @@ export class ContestCodeHandler extends Handler {
async get(domainId: string, tid: ObjectID) {
await this.limitRate('contest_code', 3600, 60);
const [tdoc, tsdocs] = await contest.getAndListStatus(domainId, tid);
if (!this.user.own(tdoc) && !this.user.hasPriv(PRIV.PRIV_READ_RECORD)) {
this.checkPerm(PERM.PERM_READ_RECORD);
if (!this.user.own(tdoc) && !this.user.hasPriv(PRIV.PRIV_READ_RECORD_CODE)) {
this.checkPerm(PERM.PERM_READ_RECORD_CODE);
}
if (!contest.canShowRecord.call(this, tdoc as any, true)) {
throw new PermissionError(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);