mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: disable assign check for problem_list due to performance issue
This commit is contained in:
1 parent
dd02f9023d
commit
a256953510
2 files changed
+6
-17
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.3.4",
|
"version": "3.3.5",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -98,24 +98,13 @@ registerResolver(
|
|||||||
);
|
);
|
||||||
|
|
||||||
function buildQuery(udoc: User) {
|
function buildQuery(udoc: User) {
|
||||||
const q: FilterQuery<ProblemDoc> = {
|
const q: FilterQuery<ProblemDoc> = {};
|
||||||
$or: [
|
if (!udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) {
|
||||||
{
|
q.$or = [
|
||||||
$and: [
|
{ hidden: false },
|
||||||
{
|
|
||||||
$or: [
|
|
||||||
{ assign: { $size: 0 } },
|
|
||||||
{ assign: { $in: udoc.group } },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{ owner: udoc._id },
|
{ owner: udoc._id },
|
||||||
{ maintainer: udoc._id },
|
{ maintainer: udoc._id },
|
||||||
],
|
];
|
||||||
};
|
|
||||||
if (udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) {
|
|
||||||
q.$or[0].$and.push({ hidden: false });
|
|
||||||
}
|
}
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user