File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -4721,18 +4721,18 @@ public function createOrUpdateDocumentsWithIncrease(
47214721 $ old = Authorization::skip (fn () => $ this ->withTenant ($ document ->getTenant (), fn () => $ this ->silent (fn () => $ this ->getDocument (
47224722 $ collection ->getId (),
47234723 $ document ->getId (),
4724- [Query::select ($ selects )],
47254724 ))));
47264725 } else {
47274726 $ old = Authorization::skip (fn () => $ this ->silent (fn () => $ this ->getDocument (
47284727 $ collection ->getId (),
47294728 $ document ->getId (),
4730- [Query::select ($ selects )],
47314729 )));
47324730 }
47334731
4734- $ disallowed = ['$tenant ' , '$internalId ' ];
4735- 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 ) {
47364736 unset($ documents [$ key ]);
47374737 continue ;
47384738 }
@@ -4767,6 +4767,10 @@ public function createOrUpdateDocumentsWithIncrease(
47674767 ->setAttribute ('$createdAt ' , empty ($ createdAt ) || !$ this ->preserveDates ? $ time : $ createdAt )
47684768 ->setAttribute ('$updatedAt ' , empty ($ updatedAt ) || !$ this ->preserveDates ? $ time : $ updatedAt );
47694769
4770+ if (!$ updatesPermissions ) {
4771+ $ document ->setAttribute ('$permissions ' , $ old ->getPermissions ());
4772+ }
4773+
47704774 if ($ this ->adapter ->getSharedTables ()) {
47714775 if ($ this ->adapter ->getTenantPerDocument ()) {
47724776 if ($ document ->getTenant () === null ) {
You can’t perform that action at this time.
0 commit comments