core: fix contest permission check

This commit is contained in:
undefined committed 2023-03-26 22:57:43 +08:00
1 parent 78b6c6b913
commit dde46c6e7f
4 files changed
+20 -21

No files matched your search

+2 -4
View File
@@ -331,10 +331,8 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler {
async exportScoreboard(domainId: string, tid: ObjectId, ext: string) {
await this.limitRate('scoreboard_download', 60, 3);
if (ext === 'ghost') {
if ((contest.isDone(this.tdoc) || contest.isLocked(this.tdoc)) && !this.tdoc.unlocked) {
if (!this.user.own(this.tdoc)) {
this.checkPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
}
if (contest.isLocked(this.tdoc) && !this.user.own(this.tdoc)) {
this.checkPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
}
await this.exportGhost(domainId, tid);
return;