2015-11-12 03:22:59 +08:00
|
|
|
-- Use regular user role
|
|
|
|
SET ROLE test_regular_user;
|
|
|
|
|
|
|
|
-- Exercise the public function
|
|
|
|
-- it is public, it shall work
|
2015-11-17 18:30:25 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_admin0_polygon('Spain');
|
2015-11-13 19:32:36 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_admin1_polygon('California');
|
|
|
|
SELECT cdb_geocoder_client.geocode_admin1_polygon('California', 'United States');
|
|
|
|
SELECT cdb_geocoder_client.geocode_namedplace_point('Elx');
|
|
|
|
SELECT cdb_geocoder_client.geocode_namedplace_point('Elx', 'Valencia');
|
|
|
|
SELECT cdb_geocoder_client.geocode_namedplace_point('Elx', 'Valencia', 'Spain');
|
|
|
|
SELECT cdb_geocoder_client.geocode_postalcode_polygon('03204', 'Spain');
|
2015-11-13 20:04:46 +08:00
|
|
|
SELECT cdb_geocoder_client.geocode_postalcode_point('03204', 'Spain');
|
2015-11-24 17:06:55 +08:00
|
|
|
SELECT cdb_geocoder_client.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-20 17:51:19 +08:00
|
|
|
SELECT cdb_geocoder_client._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_geocoder_client._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_geocoder_client._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_geocoder_client._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_geocoder_client._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_geocoder_client._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_geocoder_client._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_geocoder_client._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');
|
2015-11-24 17:06:55 +08:00
|
|
|
SELECT cdb_geocoder_client._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');
|