From b2408958cb536655151958dc563cafc4e8b7de32 Mon Sep 17 00:00:00 2001 From: slashlight Date: Fri, 29 Nov 2024 17:06:52 +0300 Subject: [PATCH] feat: added DB roles for microservices --- DB/migrations/000002_init_roles.up.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DB/migrations/000002_init_roles.up.sql b/DB/migrations/000002_init_roles.up.sql index 6a1c4212..9ffc16cb 100644 --- a/DB/migrations/000002_init_roles.up.sql +++ b/DB/migrations/000002_init_roles.up.sql @@ -7,7 +7,11 @@ GRANT SELECT, INSERT, DELETE, UPDATE ON profile, friend TO profile_service; CREATE ROLE community_service WITH LOGIN PASSWORD 'community_password'; GRANT CONNECT ON DATABASE mydbvk TO community_service; -GRANT SELECT, INSERT, DELETE, UPDATE ON community, community_profile TO community_service; +GRANT USAGE ON SCHEMA public TO community_service; +GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES, TRUNCATE, TRIGGER, MAINTAIN ON community, community_profile TO community_service; +GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO community_service; +GRANT ALL PRIVILEGES ON community, community_profile, admin TO community_service; +GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO community_service; CREATE ROLE post_service WITH LOGIN PASSWORD 'post_password'; GRANT CONNECT ON DATABASE mydbvk TO post_service;