Revoke select on table and add security definer for conf getter

This commit is contained in:
Juan Ignacio Sánchez Lara 2015-08-19 10:35:23 +02:00
parent 8a8d4b5b00
commit 0cb55d043a

View File

@ -2,7 +2,6 @@
DO LANGUAGE 'plpgsql' $$ DO LANGUAGE 'plpgsql' $$
BEGIN BEGIN
CREATE TABLE IF NOT EXISTS cartodb.CDB_CONF ( PARAM TEXT PRIMARY KEY, CONF TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS cartodb.CDB_CONF ( PARAM TEXT PRIMARY KEY, CONF TEXT NOT NULL );
EXECUTE format('GRANT SELECT ON cartodb.CDB_CONF TO %s', cartodb.CDB_Organization_Member_Group_Role_Member_Name());
END END
$$; $$;
@ -33,7 +32,7 @@ BEGIN
EXECUTE 'select cartodb._CDB_Conf_Cache(''get'', $1) as conf;' INTO conf USING param; EXECUTE 'select cartodb._CDB_Conf_Cache(''get'', $1) as conf;' INTO conf USING param;
RETURN conf; RETURN conf;
END END
$$ LANGUAGE PLPGSQL STABLE; $$ LANGUAGE PLPGSQL STABLE SECURITY DEFINER;
-- Single cache function allowing SD private dict usage -- Single cache function allowing SD private dict usage
CREATE OR REPLACE CREATE OR REPLACE