mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core&ui: fix record display (#693)
This commit is contained in:
1 parent
323f6b72f1
commit
e0db6c6d47
4 files changed
+12
-2
No files matched your search
@@ -280,6 +280,12 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler {
|
||||
await record.getMulti(domainId, { contest: tid, uid: this.user._id })
|
||||
.sort({ _id: -1 }).toArray(),
|
||||
]);
|
||||
if (!this.user.own(this.tdoc) && !this.user.hasPerm(PERM.PERM_EDIT_CONTEST)) {
|
||||
this.response.body.rdocs = this.response.body.rdocs.map((rdoc) => contest.applyProjection(this.tdoc, rdoc, this.user));
|
||||
for (const psdoc of psdocs) {
|
||||
this.response.body.rdict[psdoc.rid] = contest.applyProjection(this.tdoc, this.response.body.rdict[psdoc.rid], this.user);
|
||||
}
|
||||
}
|
||||
this.response.body.canViewRecord = true;
|
||||
} else {
|
||||
for (const i of psdocs) this.response.body.rdict[i.rid] = { _id: i.rid };
|
||||
|
||||
Reference in new issue
Block a user