passes id of document to access operations where required

This commit is contained in:
James
2020-08-24 17:02:03 -04:00
parent 45da1369ca
commit b197d780c1
6 changed files with 14 additions and 7 deletions

View File

@@ -28,7 +28,7 @@ async function update(args) {
// 1. Execute access
// /////////////////////////////////////
const accessResults = !overrideAccess ? await executeAccess({ req }, collectionConfig.access.update) : true;
const accessResults = !overrideAccess ? await executeAccess({ req, id }, collectionConfig.access.update) : true;
const hasWhereAccess = typeof accessResults === 'object';
// /////////////////////////////////////
@@ -91,6 +91,7 @@ async function update(args) {
data = await this.performFieldOperations(collectionConfig, {
data,
req,
id,
hook: 'beforeChange',
operation: 'update',
originalDoc,
@@ -149,6 +150,7 @@ async function update(args) {
hook: 'afterRead',
operation: 'read',
req,
id,
depth,
overrideAccess,
});