mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 09:36:08 +08:00
core: fix record problem permission check
This commit is contained in:
1 parent
3d19e9578c
commit
5ef7b94df8
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.3.2",
|
||||
"version": "3.3.3",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user