Mercurial > gemma
annotate schema/updates/1425/01.inline_utm_covers.sql @ 5259:680be197844d
Merged branch new-fwa.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Wed, 13 May 2020 11:28:34 +0200 |
parents | 388947a3050d |
children |
rev | line source |
---|---|
5014
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 ALTER POLICY responsibility_area ON waterway.bottlenecks |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 USING (staging_done |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 OR (SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 ST_Transform(CAST(area AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 FROM users.current_user_area_utm() AS a (a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 WITH CHECK ((SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 ST_Transform(CAST(area AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 FROM users.current_user_area_utm() AS a (a))); |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 ALTER POLICY responsibility_area ON waterway.sounding_results |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 USING (staging_done |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 OR (SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 ST_Transform(CAST(area AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 FROM users.current_user_area_utm() AS a (a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 WITH CHECK ((SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 ST_Transform(CAST(area AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 FROM users.current_user_area_utm() AS a (a))); |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 ALTER POLICY responsibility_area ON waterway.fairway_dimensions |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 USING (staging_done |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 OR (SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 ST_Transform(CAST(area AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
23 FROM users.current_user_area_utm() AS a (a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
24 WITH CHECK ((SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 ST_Transform(CAST(area AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
26 FROM users.current_user_area_utm() AS a (a))); |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
28 ALTER POLICY responsibility_area_insert ON waterway.waterway_axis |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
29 WITH CHECK ((SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
30 ST_Transform(CAST(wtwaxs AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
31 FROM users.current_user_area_utm() AS a (a))); |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
32 |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
33 ALTER POLICY responsibility_area_update ON waterway.waterway_axis |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
34 USING ((SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
35 ST_Transform(CAST(wtwaxs AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
36 FROM users.current_user_area_utm() AS a (a))); |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
37 |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
38 ALTER POLICY responsibility_area_delete ON waterway.waterway_axis |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
39 USING ((SELECT ST_Covers(a, |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
40 ST_Transform(CAST(wtwaxs AS geometry), ST_SRID(a))) |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
41 FROM users.current_user_area_utm() AS a (a))); |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
42 |
388947a3050d
Inline SQL function in row level security policies
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
43 DROP FUNCTION users.utm_covers; |