Skip to content

Commit 9aa4206

Browse files
abnegateclaude
andcommitted
fix: use raw tenant attribute to avoid type mismatch in update comparison
getTenant() casts numeric strings to int, but the no-change comparison uses strict equality. This caused false shouldUpdate=true, triggering authorization checks on documents with only read permissions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b9727f2 commit 9aa4206

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Database/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6055,7 +6055,7 @@ public function updateDocument(string $collection, string $id, Document $documen
60556055
$document['$createdAt'] = ($createdAt === null || !$this->preserveDates) ? $old->getCreatedAt() : $createdAt;
60566056

60576057
if ($this->adapter->getSharedTables()) {
6058-
$document['$tenant'] = $old->getTenant(); // Make sure user doesn't switch tenant
6058+
$document['$tenant'] = $old->getAttribute('$tenant'); // Make sure user doesn't switch tenant
60596059
}
60606060
$document = new Document($document);
60616061

0 commit comments

Comments
 (0)