From df36e83cb552bb8cb287a12b53a562730003807f Mon Sep 17 00:00:00 2001 From: javi Date: Mon, 27 Jul 2015 10:31:55 +0200 Subject: [PATCH] revoke permissions to list private tables to public user --- scripts-available/CDB_UserTables.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts-available/CDB_UserTables.sql b/scripts-available/CDB_UserTables.sql index 9f636a5..bfa5165 100644 --- a/scripts-available/CDB_UserTables.sql +++ b/scripts-available/CDB_UserTables.sql @@ -17,9 +17,8 @@ WHERE c.relkind = 'r' AND c.relname NOT IN ('cdb_tablemetadata', 'spatial_ref_sys') AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'topology') AND CASE WHEN perm = 'public' THEN has_table_privilege('publicuser', c.oid, 'SELECT') - WHEN perm = 'private' THEN (has_table_privilege(c.relowner, c.oid, 'SELECT') OR has_table_privilege(current_user, c.oid, 'SELECT')) - AND NOT has_table_privilege('publicuser', c.oid, 'SELECT') - WHEN perm = 'all' THEN has_table_privilege(c.relowner, c.oid, 'SELECT') OR has_table_privilege('publicuser', c.oid, 'SELECT') + WHEN perm = 'private' THEN has_table_privilege(current_user, c.oid, 'SELECT') AND NOT has_table_privilege('publicuser', c.oid, 'SELECT') + WHEN perm = 'all' THEN has_table_privilege(current_user, c.oid, 'SELECT') OR has_table_privilege('publicuser', c.oid, 'SELECT') ELSE false END; $$ LANGUAGE 'sql';