Skip to content

Commit ffe9b9a

Browse files
committed
Fix permission test
1 parent fc907a3 commit ffe9b9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/e2e/Adapter/Scopes/VectorTests.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,7 @@ public function testVectorSearchWithRestrictedPermissions(): void
16031603

16041604
// Query as user1 - should only see doc1 and doc3
16051605
Authorization::setRole(Role::user('user1')->toString());
1606+
Authorization::setRole(Role::any()->toString());
16061607
$results = $database->find('vectorPermissions', [
16071608
Query::vectorCosine('embedding', [1.0, 0.0, 0.0])
16081609
]);
@@ -1614,7 +1615,9 @@ public function testVectorSearchWithRestrictedPermissions(): void
16141615
$this->assertNotContains('Doc 2', $names);
16151616

16161617
// Query as user2 - should only see doc2 and doc3
1618+
Authorization::cleanRoles();
16171619
Authorization::setRole(Role::user('user2')->toString());
1620+
Authorization::setRole(Role::any()->toString());
16181621
$results = $database->find('vectorPermissions', [
16191622
Query::vectorCosine('embedding', [1.0, 0.0, 0.0])
16201623
]);
@@ -1626,6 +1629,7 @@ public function testVectorSearchWithRestrictedPermissions(): void
16261629
$this->assertNotContains('Doc 1', $names);
16271630

16281631
Authorization::cleanRoles();
1632+
Authorization::setRole(Role::any()->toString());
16291633

16301634
// Cleanup
16311635
$database->deleteCollection('vectorPermissions');

0 commit comments

Comments
 (0)