2015-11-12 03:22:59 +08:00
|
|
|
-- Use regular user role
|
|
|
|
SET ROLE test_regular_user;
|
|
|
|
|
2015-11-24 20:30:18 +08:00
|
|
|
-- Add to the search path the schema
|
2015-11-27 20:20:55 +08:00
|
|
|
SET search_path TO public,cartodb,cdb_geocoder_client;
|
2015-11-24 20:30:18 +08:00
|
|
|
|
2015-11-12 03:22:59 +08:00
|
|
|
-- Exercise the public function
|
|
|
|
-- it is public, it shall work
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT cdb_geocode_admin0_polygon('Spain');
|
|
|
|
SELECT cdb_geocode_admin1_polygon('California');
|
|
|
|
SELECT cdb_geocode_admin1_polygon('California', 'United States');
|
|
|
|
SELECT cdb_geocode_namedplace_point('Elx');
|
|
|
|
SELECT cdb_geocode_namedplace_point('Elx', 'Valencia');
|
|
|
|
SELECT cdb_geocode_namedplace_point('Elx', 'Valencia', 'Spain');
|
|
|
|
SELECT cdb_geocode_postalcode_polygon('03204', 'Spain');
|
|
|
|
SELECT cdb_geocode_postalcode_point('03204', 'Spain');
|
|
|
|
SELECT cdb_geocode_ipaddress_point('8.8.8.8');
|
2015-11-12 03:22:59 +08:00
|
|
|
|
|
|
|
-- Check the regular user has no permissions on private functions
|
2015-11-24 20:30:18 +08:00
|
|
|
SELECT _cdb_geocode_admin0_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Hell');
|
|
|
|
SELECT _cdb_geocode_admin1_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Hell');
|
|
|
|
SELECT _cdb_geocode_admin1_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol', 'Hell');
|
|
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol');
|
|
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol', 'Hell');
|
|
|
|
SELECT _cdb_geocode_namedplace_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', 'Sheol', 'Hell', 'Ugly world');
|
|
|
|
SELECT _cdb_geocode_postalcode_polygon('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', '66666', 'Hell');
|
|
|
|
SELECT _cdb_geocode_postalcode_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', '66666', 'Hell');
|
|
|
|
SELECT _cdb_geocode_ipaddress_point('evil_user', '{"is_organization": false, "entity_name": "test_user"}', '{"street_geocoder_provider": "nokia","nokia_monthly_quota": 100, "nokia_soft_geocoder_limit": false}', '8.8.8.8');
|