mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix admin can not view all related contest (#1011)
This commit is contained in:
1 parent
d7b41fdb2e
commit
627ce77d30
1 file changed
+3
-1
@@ -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,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user