Skip to content

Commit ef6a7dd

Browse files
committed
Get current permissions from the database
1 parent 49826b6 commit ef6a7dd

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

src/Database/Adapter/MariaDB.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -986,14 +986,6 @@ public function updateDocument(Document $collection, string $id, Document $docum
986986
$columns = '';
987987

988988
if (!$skipPermissions) {
989-
/**
990-
* Permission rows in the _perms table are keyed by the document's
991-
* UID (the _document column). Replace the permissions with a full
992-
* rewrite: delete every existing row for the (old) UID, then
993-
* re-insert the document's current permission set under the (new)
994-
* UID. This keeps the logic simple and correctly re-keys the
995-
* permission rows when the UID changes.
996-
*/
997989
$newUid = $document->offsetExists('$id') ? $document->getId() : $id;
998990

999991
$sql = "
@@ -1011,10 +1003,6 @@ public function updateDocument(Document $collection, string $id, Document $docum
10111003
$stmtRemovePermissions->bindValue(':_tenant', $this->tenant);
10121004
}
10131005

1014-
/**
1015-
* Insert the document's full current permission set under the
1016-
* (new) UID.
1017-
*/
10181006
$values = [];
10191007
foreach (Database::PERMISSIONS as $type) {
10201008
foreach ($document->getPermissionsByType($type) as $i => $_) {

0 commit comments

Comments
 (0)