diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index c7ee4bb66..2a266849c 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -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, + )); } }