From 6a5d67eaa0339b2e8c8df6f5f5e4cb639b21921c Mon Sep 17 00:00:00 2001 From: Hans Petter Simonsen Date: Tue, 10 Dec 2024 12:50:41 +0100 Subject: [PATCH] =?UTF-8?q?Grant=20lesetilgang=20p=C3=A5=20alle=20tabeller?= =?UTF-8?q?=20til=20cloudsqliam=20rollen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V9__grant_lesetilgang_til_clousqliamuser.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/main/resources/db/migration/V9__grant_lesetilgang_til_clousqliamuser.sql diff --git a/src/main/resources/db/migration/V9__grant_lesetilgang_til_clousqliamuser.sql b/src/main/resources/db/migration/V9__grant_lesetilgang_til_clousqliamuser.sql new file mode 100644 index 000000000..1183e824b --- /dev/null +++ b/src/main/resources/db/migration/V9__grant_lesetilgang_til_clousqliamuser.sql @@ -0,0 +1,10 @@ +DO +$$ + BEGIN + IF (SELECT exists(SELECT rolname FROM pg_roles WHERE rolname = 'cloudsqliamuser')) + THEN + ALTER DEFAULT PRIVILEGES IN SCHEMA veilarbaktivitet GRANT SELECT ON TABLES TO "cloudsqliamuser"; + GRANT SELECT ON ALL TABLES IN SCHEMA veilarbaktivitet TO "cloudsqliamuser"; + END IF; + END +$$;