File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4729,8 +4729,10 @@ public function createOrUpdateDocumentsWithIncrease(
47294729 )));
47304730 }
47314731
4732- $ disallowed = ['$tenant ' , '$internalId ' ];
4733- if ($ old ->getArrayCopy (disallow: $ disallowed ) == $ document ->getArrayCopy (disallow: $ disallowed )) {
4732+ $ updatesPermissions = \in_array ('$permissions ' , \array_keys ($ document ->getArrayCopy ()))
4733+ && $ document ->getPermissions () != $ old ->getPermissions ();
4734+
4735+ if ($ old ->getAttributes () == $ document ->getAttributes () && !$ updatesPermissions ) {
47344736 unset($ documents [$ key ]);
47354737 continue ;
47364738 }
@@ -4765,6 +4767,10 @@ public function createOrUpdateDocumentsWithIncrease(
47654767 ->setAttribute ('$createdAt ' , empty ($ createdAt ) || !$ this ->preserveDates ? $ time : $ createdAt )
47664768 ->setAttribute ('$updatedAt ' , empty ($ updatedAt ) || !$ this ->preserveDates ? $ time : $ updatedAt );
47674769
4770+ if (!$ updatesPermissions ) {
4771+ $ document ->setAttribute ('$permissions ' , $ old ->getPermissions ());
4772+ }
4773+
47684774 if ($ this ->adapter ->getSharedTables ()) {
47694775 if ($ this ->adapter ->getTenantPerDocument ()) {
47704776 if ($ document ->getTenant () === null ) {
You can’t perform that action at this time.
0 commit comments