diff schema/tap_tests_data.sql @ 5025:4c658a8f34da

Fix row level security policies for waterway admin Since 'staging_done OR' was added to the conditions to improve performance for read access, it was also allowed to delete and partly update entries with staging_done set to true but otherwise being outside the country of the respective waterway admin. Using an extra policy for each command and using the 'staging_done OR' tweak only FOR SELECT should fix authorization while keeping performance.
author Tom Gottfried <tom@intevation.de>
date Wed, 18 Mar 2020 12:16:42 +0100
parents e8b2dc771f9e
children 147a2585e136
line wrap: on
line diff
--- a/schema/tap_tests_data.sql	Mon Mar 16 17:11:53 2020 +0100
+++ b/schema/tap_tests_data.sql	Wed Mar 18 12:16:42 2020 +0100
@@ -102,6 +102,20 @@
         ST_geomfromtext('MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))', 4326),
         'AT', 'AT', 'AT',
         1, 'depth', current_timestamp, 'testorganization', true
+    ), (
+        'testbottleneck3',
+        isrsrange(('RO', 'XXX', '00001', '00000', 0)::isrs,
+            ('RO', 'XXX', '00001', '00000', 2)::isrs),
+        ST_geomfromtext('MULTIPOLYGON(((1 0, 1 1, 2 1, 2 0, 1 0)))', 4326),
+        'RO', 'RO', 'RO',
+        1, 'depth', current_timestamp, 'testorganization', true
+    ), (
+        'testbottleneck4',
+        isrsrange(('RO', 'XXX', '00001', '00000', 0)::isrs,
+            ('RO', 'XXX', '00001', '00000', 2)::isrs),
+        ST_geomfromtext('MULTIPOLYGON(((1 0, 1 1, 2 1, 2 0, 1 0)))', 4326),
+        'RO', 'RO', 'RO',
+        1, 'depth', current_timestamp, 'testorganization', true
     ))
 INSERT INTO waterway.bottlenecks (
     gauge_location, validity,