core: fix admin can not view all related contest (#1011)

This commit is contained in:
panda authored and GitHub committed 2025-07-07 15:30:00 +01:00
1 parent d7b41fdb2e
commit 627ce77d30
1 file changed
+3 -1
+3 -1
View File
@@ -391,7 +391,9 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
[this.response.body.ctdocs, this.response.body.htdocs] = (await Promise.all([
contest.getRelated(this.args.domainId, this.pdoc.docId),
contest.getRelated(this.args.domainId, this.pdoc.docId, 'homework'),
])).map((tdocs) => tdocs.filter((tdoc) => !tdoc.assign?.length || Set.intersection(tdoc.assign, this.user.group).size));
])).map((tdocs) => tdocs.filter((tdoc) =>
this.user.hasPerm(PERM.PERM_VIEW_HIDDEN_CONTEST) || !tdoc.assign?.length || Set.intersection(tdoc.assign, this.user.group).size,
));
}
}