core: fix record problem permission check

This commit is contained in:
undefined committed 2022-01-07 22:42:41 +08:00
1 parent 3d19e9578c
commit 5ef7b94df8
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.3.2",
"version": "3.3.3",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1 -1
View File
@@ -249,7 +249,7 @@ class RecordMainConnectionHandler extends ConnectionHandler {
]);
const tdoc = this.tid ? this.tdoc || await contest.get(rdoc.domainId, new ObjectID(this.tid)) : null;
if (pdoc && !rdoc.contest) {
if (problem.canViewBy(pdoc, this.user)) pdoc = null;
if (!problem.canViewBy(pdoc, this.user)) pdoc = null;
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
}
if (this.pretest) this.send({ rdoc });