diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index 1e7dd0bf5..d3840bc8c 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -290,7 +290,7 @@ export class ContestScoreboardHandler extends ContestDetailBaseHandler { if (!realtime && this.tdoc.lockAt && !this.tdoc.unlocked) { config.lockAt = this.tdoc.lockAt; } - const allGroups = this.user.hasPerm(PERM.PERM_EDIT_CONTEST_SELF) || (this.user.own(this.tdoc) && this.user.hasPerm(PERM.PERM_EDIT_CONTEST)); + const allGroups = (this.user.hasPerm(PERM.PERM_EDIT_CONTEST_SELF) && this.user.own(this.tdoc)) || this.user.hasPerm(PERM.PERM_EDIT_CONTEST); const [[, rows, udict, pdict], groups] = await Promise.all([ contest.getScoreboard.call(this, domainId, tid, config), user.listGroup(domainId, allGroups ? undefined : this.user._id),