core: hide scoreboard before contest (#607)

This commit is contained in:
panda authored and GitHub committed 2023-07-04 17:27:20 +08:00
1 parent 24acd0918d
commit 3e49c5bf7b
1 file changed
+1
+1
View File
@@ -288,6 +288,7 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler {
@param('realtime', Types.Boolean)
async get(domainId: string, tid: ObjectId, ext = '', realtime) {
if (!contest.canShowScoreboard.call(this, this.tdoc, true)) throw new ContestScoreboardHiddenError(tid);
if (contest.isNotStarted(this.tdoc)) throw new ContestNotLiveError(domainId, tid);
if (realtime && !this.user.own(this.tdoc)) {
this.checkPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
}