mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix contest permission check
This commit is contained in:
4 files changed
+20
-21
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user