Skip to content

Commit

Permalink
fix: doc access should not run where query on collections without id
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrodMFlesch committed Dec 16, 2022
1 parent 0fbfe14 commit 016beb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/getEntityPolicies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function getEntityPolicies<T extends Args>(args: T): ReturnType<T> {

if (typeof accessResult === 'object' && !disableWhere) {
mutablePolicies[operation] = {
permission: !!(await getEntityDoc({ where: accessResult })),
permission: id ? !!(await getEntityDoc({ where: accessResult })) : true,
where: accessResult,
};
} else if (mutablePolicies[operation]?.permission !== false) {
Expand Down

0 comments on commit 016beb6

Please sign in to comment.