comparison schema/auth.sql @ 312:0745b4d336c4

Place functions in more matching schemas check_password is not meant to be user-visible API. current_user_country smells like user management related.
author Tom Gottfried <tom@intevation.de>
date Wed, 01 Aug 2018 17:35:12 +0200
parents 750a9c9cd965
children 10b93a8ee057
comparison
equal deleted inserted replaced
311:74559e12a59f 312:0745b4d336c4
78 -- Staging area 78 -- Staging area
79 -- TODO: add all relevant tables here 79 -- TODO: add all relevant tables here
80 CREATE POLICY responsibility_area ON waterway.bottlenecks 80 CREATE POLICY responsibility_area ON waterway.bottlenecks
81 FOR ALL TO waterway_admin 81 FOR ALL TO waterway_admin
82 USING (ST_Within(area, (SELECT area FROM users.responsibility_areas 82 USING (ST_Within(area, (SELECT area FROM users.responsibility_areas
83 WHERE country = current_user_country()))); 83 WHERE country = users.current_user_country())));
84 CREATE POLICY responsibility_area ON waterway.sounding_results 84 CREATE POLICY responsibility_area ON waterway.sounding_results
85 FOR ALL TO waterway_admin 85 FOR ALL TO waterway_admin
86 USING (ST_Within(area, (SELECT area FROM users.responsibility_areas 86 USING (ST_Within(area, (SELECT area FROM users.responsibility_areas
87 WHERE country = current_user_country()))); 87 WHERE country = users.current_user_country())));
88 88
89 COMMIT; 89 COMMIT;