Mercurial > gemma
comparison schema/updates/1424/01.add_axis_rls.sql @ 5013:7dff1015283d
Add row level security policies for waterway axis
Enforcing the area of responsibility this way instead of leaving it
up to the importer implementation will also reduce complexity of
statements needed to implement keeping of historic axis data.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 12 Mar 2020 14:49:19 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5012:ae3a1392f9d0 | 5013:7dff1015283d |
---|---|
1 CREATE POLICY hide_nothing ON waterway.waterway_axis | |
2 FOR SELECT TO waterway_user USING (true); | |
3 CREATE POLICY sys_admin ON waterway.waterway_axis | |
4 FOR ALL TO sys_admin USING (true); | |
5 | |
6 CREATE POLICY responsibility_area_insert ON waterway.waterway_axis | |
7 FOR INSERT TO waterway_admin | |
8 WITH CHECK (users.utm_covers(wtwaxs)); | |
9 CREATE POLICY responsibility_area_update ON waterway.waterway_axis | |
10 FOR UPDATE TO waterway_admin | |
11 USING (users.utm_covers(wtwaxs)); | |
12 CREATE POLICY responsibility_area_delete ON waterway.waterway_axis | |
13 FOR DELETE TO waterway_admin | |
14 USING (users.utm_covers(wtwaxs)); | |
15 | |
16 ALTER TABLE waterway.waterway_axis ENABLE ROW LEVEL SECURITY; |