mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
7 lines
310 B
SQL
7 lines
310 B
SQL
-- Enable row-level security on the users table.
|
|
ALTER TABLE "users" ENABLE ROW LEVEL SECURITY;
|
|
|
|
-- Create a policy that restricts access to rows in the users table based on the current tenant.
|
|
CREATE POLICY tenant_isolation ON "users"
|
|
USING ("tenant_id" = current_setting('app.current_tenant')::integer);
|