Skip to content

Commit 22f92e3

Browse files
committed
perms
1 parent 32aa3f9 commit 22f92e3

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/Database/Adapter/SQL.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,8 @@ public function getDocument(Document $collection, string $id, array $queries = [
361361

362362
$alias = Query::DEFAULT_ALIAS;
363363

364-
//, _permissions as {$this->quote('$perms')}
365364
$sql = "
366-
SELECT {$this->getAttributeProjection($queries, $spatialAttributes)}
365+
SELECT {$this->getAttributeProjection($queries, $spatialAttributes)}, _permissions as {$this->quote('$perms')}
367366
FROM {$this->getSQLTable($name)} AS {$this->quote($alias)}
368367
WHERE {$this->quote($alias)}._uid = :_uid
369368
{$this->getTenantQuery($collection, $alias)}
@@ -416,7 +415,7 @@ public function getDocument(Document $collection, string $id, array $queries = [
416415
unset($document['_permissions']);
417416
}
418417

419-
//$document['$perms'] = json_decode($document['$perms'], true);
418+
$document['$perms'] = json_decode($document['$perms'], true);
420419

421420
return new Document($document);
422421
}

tests/e2e/Adapter/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
abstract class Base extends TestCase
2121
{
2222
//use JoinsTests;
23-
use CollectionTests;
23+
//use CollectionTests;
2424
use DocumentTests;
2525
use AttributeTests;
2626
use IndexTests;

tests/e2e/Adapter/Scopes/DocumentTests.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,12 +1318,12 @@ public function testGetDocumentSelect(Document $document): Document
13181318
$this->assertArrayNotHasKey('boolean', $document->getAttributes());
13191319
$this->assertArrayNotHasKey('colors', $document->getAttributes());
13201320
$this->assertArrayNotHasKey('with-dash', $document->getAttributes());
1321-
$this->assertArrayHasKey('$id', $document);
1322-
$this->assertArrayHasKey('$sequence', $document);
1323-
$this->assertArrayHasKey('$createdAt', $document);
1324-
$this->assertArrayHasKey('$updatedAt', $document);
1325-
$this->assertArrayHasKey('$permissions', $document);
1326-
$this->assertArrayHasKey('$collection', $document);
1321+
$this->assertArrayNotHasKey('$id', $document);
1322+
$this->assertArrayNotHasKey('$sequence', $document);
1323+
$this->assertArrayNotHasKey('$createdAt', $document);
1324+
$this->assertArrayNotHasKey('$updatedAt', $document);
1325+
$this->assertArrayNotHasKey('$permissions', $document);
1326+
$this->assertArrayNotHasKey('$collection', $document);
13271327

13281328
$document = $database->getDocument('documents', $documentId, [
13291329
Query::select('string'),

0 commit comments

Comments
 (0)