Merge pull request #1690 from payloadcms/fix/doc-access
fix: doc access should not run where query on collections without id
This commit is contained in:
@@ -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 || type === 'global') ? !!(await getEntityDoc({ where: accessResult })) : true,
|
||||
where: accessResult,
|
||||
};
|
||||
} else if (mutablePolicies[operation]?.permission !== false) {
|
||||
|
||||
Reference in New Issue
Block a user