mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
36 lines
2.1 KiB
Plaintext
36 lines
2.1 KiB
Plaintext
-- default
|
|
CREATE ROW POLICY p1_01295 ON db.table AS permissive
|
|
-- same as default
|
|
CREATE ROW POLICY p2_01295 ON db.table AS permissive
|
|
CREATE ROW POLICY p3_01295 ON db.table AS permissive
|
|
-- rename
|
|
CREATE ROW POLICY p2_01295_renamed ON db.table AS permissive
|
|
-- filter
|
|
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING (a < b) AND (c > d) AS permissive
|
|
CREATE ROW POLICY p2_01295 ON db.table FOR SELECT USING id = currentUser() AS restrictive
|
|
CREATE ROW POLICY p3_01295 ON db.table FOR SELECT USING 1 AS permissive
|
|
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING 0 AS restrictive
|
|
-- to roles
|
|
CREATE ROW POLICY p1_01295 ON db.table AS permissive
|
|
CREATE ROW POLICY p2_01295 ON db.table AS permissive TO ALL
|
|
CREATE ROW POLICY p3_01295 ON db.table AS permissive TO r1_01295
|
|
CREATE ROW POLICY p4_01295 ON db.table AS permissive TO u1_01295
|
|
CREATE ROW POLICY p5_01295 ON db.table AS permissive TO r1_01295, u1_01295
|
|
CREATE ROW POLICY p6_01295 ON db.table AS permissive TO ALL EXCEPT r1_01295
|
|
CREATE ROW POLICY p7_01295 ON db.table AS permissive TO ALL EXCEPT r1_01295, u1_01295
|
|
CREATE ROW POLICY p1_01295 ON db.table AS permissive TO u1_01295
|
|
CREATE ROW POLICY p2_01295 ON db.table AS permissive
|
|
-- multiple policies in one command
|
|
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING 1 AS permissive
|
|
CREATE ROW POLICY p2_01295 ON db.table FOR SELECT USING 1 AS permissive
|
|
CREATE ROW POLICY p3_01295 ON db.table AS permissive TO u1_01295
|
|
CREATE ROW POLICY p3_01295 ON db2.table2 AS permissive TO u1_01295
|
|
CREATE ROW POLICY p4_01295 ON db.table FOR SELECT USING a = b AS permissive
|
|
CREATE ROW POLICY p5_01295 ON db2.table2 FOR SELECT USING a = b AS permissive
|
|
CREATE ROW POLICY p1_01295 ON db.table FOR SELECT USING 1 AS permissive TO ALL
|
|
CREATE ROW POLICY p2_01295 ON db.table FOR SELECT USING 1 AS permissive TO ALL
|
|
-- system.row_policies
|
|
p1_01295 ON db.table p1_01295 db table local directory (a < b) AND (c > d) permissive 0 [] []
|
|
p2_01295 ON db.table p2_01295 db table local directory id = currentUser() restrictive 0 ['u1_01295'] []
|
|
p3_01295 ON db.table p3_01295 db table local directory 1 permissive 1 [] ['r1_01295']
|