core: 修复普通用户无权限读取提交记录的问题

This commit is contained in:
undefined committed 2021-01-20 13:13:20 +08:00
1 parent dba701077c
commit 99ac6e545d
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.15.26", "version": "2.15.27",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "dist/loader.js", "main": "dist/loader.js",
"typings": "dist/loader.d.ts", "typings": "dist/loader.d.ts",
+1 -1
View File
@@ -76,7 +76,7 @@ class RecordDetailHandler extends RecordHandler {
const tdoc = await contest.get(domainId, rdoc.contest.tid, rdoc.contest.type); const tdoc = await contest.get(domainId, rdoc.contest.tid, rdoc.contest.type);
if (!this.canShowRecord(tdoc, true)) throw new PermissionError(rid); if (!this.canShowRecord(tdoc, true)) throw new PermissionError(rid);
} }
if (rdoc.uid !== this.user.uid && !this.user.hasPerm(PERM.PERM_READ_RECORD_CODE)) rdoc.code = null; if (rdoc.uid !== this.user._id && !this.user.hasPerm(PERM.PERM_READ_RECORD_CODE)) rdoc.code = null;
// eslint-disable-next-line prefer-const // eslint-disable-next-line prefer-const
let [pdoc, udoc] = await Promise.all([ let [pdoc, udoc] = await Promise.all([
problem.get(domainId, rdoc.pid), problem.get(domainId, rdoc.pid),