comparison schema/manage_users_tests.sql @ 4740:2440d2f86f4e

Authorize sections based on country of creator Disregarding the area of resposibility will allow to create sections outside of the country of the user in order to allow data analysis and aggregation based on sections spanning over multiple countries.
author Tom Gottfried <tom@intevation.de>
date Fri, 18 Oct 2019 12:04:04 +0200
parents baabc2b2f094
children b33121a54793
comparison
equal deleted inserted replaced
4739:257dd6039a28 4740:2440d2f86f4e
26 $$, 26 $$,
27 $$ 27 $$
28 SELECT best_utm(ST_Collect(area::geometry)) 28 SELECT best_utm(ST_Collect(area::geometry))
29 FROM users.stretches st 29 FROM users.stretches st
30 JOIN users.stretch_countries stc ON stc.stretch_id = st.id 30 JOIN users.stretch_countries stc ON stc.stretch_id = st.id
31 WHERE country = users.current_user_country() 31 WHERE country = users.user_country()
32 $$, 32 $$,
33 'Geometry has SRID corresponding to best_utm()'); 33 'Geometry has SRID corresponding to best_utm()');
34 34
35 SELECT ok( 35 SELECT ok(
36 ST_IsValid(users.current_user_area_utm()), 36 ST_IsValid(users.current_user_area_utm()),
167 167
168 SELECT results_eq($$ 168 SELECT results_eq($$
169 UPDATE users.list_users 169 UPDATE users.list_users
170 SET (pw, map_extent, email_address) 170 SET (pw, map_extent, email_address)
171 = ('user_at2!', 'BOX(0 0,1 1)', 'user_at_test') 171 = ('user_at2!', 'BOX(0 0,1 1)', 'user_at_test')
172 WHERE country = users.current_user_country() 172 WHERE country = users.user_country()
173 AND username <> current_user 173 AND username <> current_user
174 RETURNING * 174 RETURNING *
175 $$, 175 $$,
176 $$ 176 $$
177 SELECT '' WHERE false -- Empty result set 177 SELECT '' WHERE false -- Empty result set