mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
@@ -98,24 +98,13 @@ registerResolver(
|
||||
);
|
||||
|
||||
function buildQuery(udoc: User) {
|
||||
const q: FilterQuery<ProblemDoc> = {
|
||||
$or: [
|
||||
{
|
||||
$and: [
|
||||
{
|
||||
$or: [
|
||||
{ assign: { $size: 0 } },
|
||||
{ assign: { $in: udoc.group } },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
const q: FilterQuery<ProblemDoc> = {};
|
||||
if (!udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) {
|
||||
q.$or = [
|
||||
{ hidden: false },
|
||||
{ owner: udoc._id },
|
||||
{ maintainer: udoc._id },
|
||||
],
|
||||
};
|
||||
if (udoc.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) {
|
||||
q.$or[0].$and.push({ hidden: false });
|
||||
];
|
||||
}
|
||||
return q;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user