changeset 2921:96ac7a980ec2

Allow sys_admin to access tables in staging area without restrictions
author Tom Gottfried <tom@intevation.de>
date Wed, 03 Apr 2019 16:42:03 +0200
parents c1f2b9148cc8
children 372dc8382389
files schema/auth.sql
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/schema/auth.sql	Wed Apr 03 16:23:25 2019 +0200
+++ b/schema/auth.sql	Wed Apr 03 16:42:03 2019 +0200
@@ -102,6 +102,8 @@
     LOOP
         EXECUTE format('CREATE POLICY hide_staging ON waterway.%I '
             'FOR SELECT TO waterway_user USING (staging_done)', the_table);
+        EXECUTE format('CREATE POLICY sys_admin ON waterway.%I '
+            'FOR ALL TO sys_admin USING (true)', the_table);
         EXECUTE format('ALTER TABLE waterway.%I ENABLE ROW LEVEL SECURITY',
             the_table);
     END LOOP;
@@ -149,10 +151,6 @@
     FOR ALL TO waterway_admin
     USING (users.utm_covers(area));
 
-CREATE POLICY sys_admin ON waterway.stretches
-    FOR ALL TO sys_admin
-    USING (true);
-
 --
 -- RLS policies for imports and import config
 --