mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: hide scoreboard before contest (#607)
This commit is contained in:
1 parent
24acd0918d
commit
3e49c5bf7b
1 file changed
+1
@@ -288,6 +288,7 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler {
|
|||||||
@param('realtime', Types.Boolean)
|
@param('realtime', Types.Boolean)
|
||||||
async get(domainId: string, tid: ObjectId, ext = '', realtime) {
|
async get(domainId: string, tid: ObjectId, ext = '', realtime) {
|
||||||
if (!contest.canShowScoreboard.call(this, this.tdoc, true)) throw new ContestScoreboardHiddenError(tid);
|
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)) {
|
if (realtime && !this.user.own(this.tdoc)) {
|
||||||
this.checkPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
|
this.checkPerm(PERM.PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user