We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1a5cea commit 516ed26Copy full SHA for 516ed26
1 file changed
src/Database/Adapter/SQL.php
@@ -25,6 +25,7 @@
25
use Utopia\Database\Helpers\ID;
26
use Utopia\Database\Hook\PermissionFilter;
27
use Utopia\Database\Hook\Permissions;
28
+use Utopia\Database\Hook\Tenancy;
29
use Utopia\Database\Hook\TenantFilter;
30
use Utopia\Database\Hook\WriteContext;
31
use Utopia\Database\Index;
@@ -2889,6 +2890,11 @@ protected function syncWriteHooks(): void
2889
2890
if (empty(array_filter($this->writeHooks, fn ($h) => $h instanceof Permissions))) {
2891
$this->addWriteHook(new Permissions());
2892
}
2893
+
2894
+ $this->removeWriteHook(Tenancy::class);
2895
+ if ($this->sharedTables && $this->tenant !== null) {
2896
+ $this->addWriteHook(new Tenancy($this->tenant));
2897
+ }
2898
2899
2900
/**
0 commit comments