Skip to content

Commit 627ce77

Browse files
authored
core: fix admin can not view all related contest (#1011)
1 parent d7b41fd commit 627ce77

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/hydrooj/src/handler/problem.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
391391
[this.response.body.ctdocs, this.response.body.htdocs] = (await Promise.all([
392392
contest.getRelated(this.args.domainId, this.pdoc.docId),
393393
contest.getRelated(this.args.domainId, this.pdoc.docId, 'homework'),
394-
])).map((tdocs) => tdocs.filter((tdoc) => !tdoc.assign?.length || Set.intersection(tdoc.assign, this.user.group).size));
394+
])).map((tdocs) => tdocs.filter((tdoc) =>
395+
this.user.hasPerm(PERM.PERM_VIEW_HIDDEN_CONTEST) || !tdoc.assign?.length || Set.intersection(tdoc.assign, this.user.group).size,
396+
));
395397
}
396398
}
397399

0 commit comments

Comments
 (0)