-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathplan.json
More file actions
56 lines (56 loc) · 1.93 KB
/
plan.json
File metadata and controls
56 lines (56 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
"version": "1.0.0",
"pgschema_version": "1.8.0",
"created_at": "1970-01-01T00:00:00Z",
"source_fingerprint": {
"hash": "261f1966678419184a6d17b5ad2c09d590b77fff9dbe01fd56849d53f3079c8e"
},
"groups": [
{
"steps": [
{
"sql": "ALTER TABLE orders ENABLE ROW LEVEL SECURITY;",
"type": "table.rls",
"operation": "create",
"path": "public.orders"
},
{
"sql": "CREATE POLICY orders_user_access ON orders FOR SELECT TO PUBLIC USING (user_id IN ( SELECT users.id FROM users));",
"type": "table.policy",
"operation": "create",
"path": "public.orders.orders_user_access"
},
{
"sql": "CREATE POLICY \"UserPolicy\" ON users TO PUBLIC USING (tenant_id = (current_setting('app.current_tenant'))::integer);",
"type": "table.policy",
"operation": "create",
"path": "public.users.UserPolicy"
},
{
"sql": "CREATE POLICY admin_only ON users FOR DELETE TO PUBLIC USING (is_admin());",
"type": "table.policy",
"operation": "create",
"path": "public.users.admin_only"
},
{
"sql": "CREATE POLICY \"my-policy\" ON users FOR INSERT TO PUBLIC WITH CHECK ((role)::text = 'user');",
"type": "table.policy",
"operation": "create",
"path": "public.users.my-policy"
},
{
"sql": "CREATE POLICY \"select\" ON users FOR SELECT TO PUBLIC USING (true);",
"type": "table.policy",
"operation": "create",
"path": "public.users.select"
},
{
"sql": "CREATE POLICY user_tenant_isolation ON users FOR UPDATE TO PUBLIC USING (tenant_id = (current_setting('app.current_tenant'))::integer);",
"type": "table.policy",
"operation": "create",
"path": "public.users.user_tenant_isolation"
}
]
}
]
}