From d94e554834b34410fbffb2af4dd9a71665520941 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 1 Mar 2023 08:46:02 -0500 Subject: [PATCH] script --- grant.pg.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 grant.pg.sql diff --git a/grant.pg.sql b/grant.pg.sql new file mode 100644 index 0000000..ddc36e9 --- /dev/null +++ b/grant.pg.sql @@ -0,0 +1,10 @@ +---------access to schema----------------------------------------------------------------------------------------------------------------------------- +GRANT USAGE ON SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" TO api; +---------access to objects in schema------------------------------------------------------------------------------------------------------------------ +GRANT SELECT /*, UPDATE, INSERT, DELETE*/ ON ALL TABLES IN SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" TO api; +GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" TO api; +GRANT USAGE ON ALL SEQUENCES IN SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" TO api; +---------access to objects in schema going forward---------------------------------------------------------------------------------------------------- +ALTER DEFAULT PRIVILEGES IN SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" GRANT SELECT/*, UPDATE, INSERT, DELETE*/ ON TABLES TO api; +ALTER DEFAULT PRIVILEGES IN SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" GRANT USAGE ON SEQUENCES TO api; +ALTER DEFAULT PRIVILEGES IN SCHEMA rlarp,lgdat,pricequote,lgpgm,import,"CMS.CUSLG" GRANT EXECUTE ON FUNCTIONS TO api;