Merge branch 'master' of github.com:payloadcms/payload

This commit is contained in:
James
2022-12-16 17:39:51 -05:00

View File

@@ -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) {