snapshot of https://github.com/ent/ent.git (master, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
6
examples/rls/schema.sql
Normal file
6
examples/rls/schema.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- 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);
|
||||
Reference in New Issue
Block a user