Skip to content

Commit

Permalink
build(deps): bump mongoose version to 8.3.1 (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Junjiequan authored Apr 17, 2024
1 parent f4c4e0e commit 69d8d02
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 30 deletions.
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"luxon": "^3.2.1",
"mathjs": "^12.0.0",
"migrate-mongo": "^11.0.0",
"mongoose": "^8.0.4",
"mongoose": "^8.3.1",
"node-fetch": "^3.3.0",
"nodemailer": "^6.7.8",
"openid-client": "^5.1.8",
Expand Down
2 changes: 1 addition & 1 deletion src/auth/strategies/ldap.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class LdapStrategy extends PassportStrategy(Strategy, "ldap") {
const userFilter: FilterQuery<UserDocument> = {
$or: [
{ username: `ldap.${payload.displayName}` },
{ username: payload.displayName },
{ username: payload.displayName as string },
{ email: payload.mail as string },
],
};
Expand Down
32 changes: 26 additions & 6 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,22 +467,42 @@ export const createFullqueryFilter = <T>(
};
} else if (key === "userGroups") {
filterQuery["$or"]?.push({
ownerGroup: searchExpression<T>(model, "ownerGroup", fields[key]),
ownerGroup: searchExpression<T>(
model,
"ownerGroup",
fields[key],
) as object,
});
filterQuery["$or"]?.push({
accessGroups: searchExpression<T>(model, "accessGroups", fields[key]),
accessGroups: searchExpression<T>(
model,
"accessGroups",
fields[key],
) as object,
});
} else if (key === "ownerGroup") {
filterQuery["$or"]?.push({
ownerGroup: searchExpression<T>(model, "ownerGroup", fields[key]),
ownerGroup: searchExpression<T>(
model,
"ownerGroup",
fields[key],
) as object,
});
} else if (key === "accessGroups") {
filterQuery["$or"]?.push({
accessGroups: searchExpression<T>(model, "accessGroups", fields[key]),
accessGroups: searchExpression<T>(
model,
"accessGroups",
fields[key],
) as object,
});
} else if (key === "sharedWith") {
filterQuery["$or"]?.push({
sharedWith: searchExpression<T>(model, "sharedWith", fields[key]),
sharedWith: searchExpression<T>(
model,
"sharedWith",
fields[key],
) as object,
});
} else {
filterQuery[key as keyof FilterQuery<T>] = searchExpression<T>(
Expand Down Expand Up @@ -890,7 +910,7 @@ export const replaceLikeOperator = <T>(filter: IFilters<T>): IFilters<T> => {
if (filter.where) {
filter.where = replaceLikeOperatorRecursive(
filter.where as Record<string, unknown>,
);
) as object;
}
return filter;
};
Expand Down
10 changes: 9 additions & 1 deletion src/origdatablocks/origdatablocks.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,15 @@ export class OrigDatablocksController {
parsedFilters.where.userGroups = parsedFilters.where.userGroups ?? [];
parsedFilters.where.userGroups.push(...user.currentGroups);
} else if (canViewOwner) {
parsedFilters.where.ownerGroup = parsedFilters.where.ownerGroup ?? [];
if (!parsedFilters.where.ownerGroup) {
parsedFilters.where.ownerGroup = [];
}

parsedFilters.where.ownerGroup = Array.isArray(
parsedFilters.where.ownerGroup,
)
? parsedFilters.where.ownerGroup
: [parsedFilters.where.ownerGroup as string];
parsedFilters.where.ownerGroup.push(...user.currentGroups);
}
}
Expand Down

0 comments on commit 69d8d02

Please sign in to comment.