Skip to content

Commit fdd9270

Browse files
committed
Add code comment in runFindTriggers
1 parent 97e143a commit fdd9270

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ async function runFindTriggers(
6262
const ids = (Array.isArray(objectsFromBeforeFind) ? objectsFromBeforeFind : [objectsFromBeforeFind])
6363
.map(o => (o && (o.id || o.objectId)) || null)
6464
.filter(Boolean);
65-
65+
66+
// Objects without IDs are(normally) unsaved objects
67+
// For unsaved objects, the ACL security does not apply, so no need to redo the query.
68+
// For saved objects, we need to re-query to ensure proper ACL/CLP enforcement
6669
if (ids.length > 0) {
6770
const refilterWhere = isGet ? { objectId: ids[0] } : { objectId: { $in: ids } };
6871

0 commit comments

Comments
 (0)