core: hide scoreboard before contest (#607)

pull/610/head
panda 1 year ago committed by GitHub
parent 24acd0918d
commit 3e49c5bf7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}

Loading…
Cancel
Save