comparison schema/auth.sql @ 1547:d4b7a6d054cd

Add table to store import configuration.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 10 Dec 2018 15:55:10 +0100
parents 1000e0e71d5a
children 8ad51ad5a9ee
comparison
equal deleted inserted replaced
1546:b83928a8fadb 1547:d4b7a6d054cd
38 -- TODO: will there ever be UPDATEs or can we drop that due to historicisation? 38 -- TODO: will there ever be UPDATEs or can we drop that due to historicisation?
39 GRANT INSERT, UPDATE, DELETE ON 39 GRANT INSERT, UPDATE, DELETE ON
40 users.templates, users.user_templates TO waterway_admin; 40 users.templates, users.user_templates TO waterway_admin;
41 GRANT INSERT, UPDATE, DELETE ON 41 GRANT INSERT, UPDATE, DELETE ON
42 waterway.imports, waterway.import_logs, waterway.track_imports, 42 waterway.imports, waterway.import_logs, waterway.track_imports,
43 waterway.sounding_results 43 waterway.sounding_results, waterway.import_configuration
44 TO waterway_admin; 44 TO waterway_admin;
45 45
46 -- 46 --
47 -- Extended privileges for sys_admin 47 -- Extended privileges for sys_admin
48 -- 48 --
149 149
150 CREATE POLICY responsibility_area ON waterway.sounding_results 150 CREATE POLICY responsibility_area ON waterway.sounding_results
151 FOR ALL TO waterway_admin 151 FOR ALL TO waterway_admin
152 USING (utm_covers(area)); 152 USING (utm_covers(area));
153 153
154 CREATE POLICY import_configuration_policy ON waterway.import_configuration
155 FOR ALL TO waterway_admin
156 USING (
157 users.current_user_country() = (
158 SELECT country FROM users.list_users lu
159 WHERE lu.username = waterway.import_configuration.username));
160
161 ALTER table waterway.import_configuration ENABLE ROW LEVEL SECURITY;
162
154 COMMIT; 163 COMMIT;