adds ability to override depth on auth user

This commit is contained in:
James
2020-10-26 16:56:03 -04:00
parent 9fd3e8d84f
commit 082bf2fba4
3 changed files with 4 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ module.exports = ({ operations }, { Model, config }) => {
},
req,
overrideAccess: true,
depth: config.auth.depth,
});
if (userQuery.docs && userQuery.docs.length > 0) {

View File

@@ -37,11 +37,13 @@ module.exports = ({ config, collections, operations }) => {
equals: token.email,
};
}
const userQuery = await operations.collections.find({
where,
collection,
req,
overrideAccess: true,
depth: collection.config.auth.depth,
});
if (userQuery.docs && userQuery.docs.length > 0) {