core: fix contest scoreboard groups check (#820)

This commit is contained in:
panda authored and GitHub committed 2024-06-06 13:18:08 +08:00
1 parent 3a26cfbfe3
commit d802a81a45
1 file changed
+1 -1
+1 -1
View File
@@ -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),