a7748f71c3
Based on roles and by default closing everything. No need to tweak things outside of the extension.
20 lines
1006 B
Plaintext
20 lines
1006 B
Plaintext
-- Use regular user role
|
|
SET ROLE test_regular_user;
|
|
-- Exercise the public function
|
|
-- it is public, it shall work
|
|
SELECT cdb_geocoder_client.geocode_admin0_polygons('Spain');
|
|
NOTICE: cdb_geocoder_client._geocode_admin0_polygons(3): [contrib_regression] REMOTE NOTICE: cbd_geocoder_server.geocode_admin0_polygons invoked with params (postgres, some_transaction_id, Spain)
|
|
CONTEXT: SQL statement "SELECT cdb_geocoder_client._geocode_admin0_polygons(session_user, txid_current(), country_name)"
|
|
PL/pgSQL function cdb_geocoder_client.geocode_admin0_polygons(text) line 5 at SQL statement
|
|
geocode_admin0_polygons
|
|
-------------------------
|
|
|
|
(1 row)
|
|
|
|
-- Check the regular user has no permissions on private functions
|
|
SELECT cdb_geocoder_client._geocode_admin0_polygons('evil_user', 666, 'Hell');
|
|
ERROR: permission denied for function _geocode_admin0_polygons
|
|
-- Check the regular user cannot look into config table
|
|
SELECT * from cdb_geocoder_client._config;
|
|
ERROR: permission denied for relation _config
|