mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "3.3.2",
|
"version": "3.3.3",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "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;
|
const tdoc = this.tid ? this.tdoc || await contest.get(rdoc.domainId, new ObjectID(this.tid)) : null;
|
||||||
if (pdoc && !rdoc.contest) {
|
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.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
|
||||||
}
|
}
|
||||||
if (this.pretest) this.send({ rdoc });
|
if (this.pretest) this.send({ rdoc });
|
||||||
|
|||||||
Reference in new issue
Block a user