Skip to content

Commit 20dd6e4

Browse files
committed
Database.php
1 parent 0b6c76a commit 20dd6e4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Database/Database.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6183,6 +6183,14 @@ public function updateDocument(string $collection, string $id, Document $documen
61836183
}
61846184
$document = new Document($document);
61856185

6186+
// A UID change re-keys the permission rows (_perms._document) to the
6187+
// new UID, so the permission block must run even when the permission
6188+
// set itself is unchanged. Otherwise the old rows are orphaned and the
6189+
// new UID is left with no permissions.
6190+
if ($document->getId() !== $id) {
6191+
$skipPermissionsUpdate = false;
6192+
}
6193+
61866194
$attributes = $collection->getAttribute('attributes', []);
61876195

61886196
$relationships = \array_filter($attributes, function ($attribute) {

0 commit comments

Comments
 (0)