Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump mongoose version to 8.3.1 #1174

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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