Files
mtusi2026lab7/infra/postgres/grants.sql
T
2026-11-18 11:36:21 +03:00

11 lines
727 B
SQL

REVOKE CREATE ON SCHEMA public FROM PUBLIC;
GRANT USAGE ON SCHEMA public TO api_role,worker_role,dispatcher_role;
GRANT SELECT,INSERT,UPDATE ON users,refresh_tokens,chats,chat_members,messages,message_idempotency,message_attachments,attachments,attachment_jobs,job_slo,outbox TO api_role;
GRANT SELECT ON attachment_variants TO api_role;
GRANT SELECT,UPDATE ON attachments,attachment_jobs,job_slo TO worker_role;
GRANT INSERT,SELECT ON attachment_variants,job_audit TO worker_role;
GRANT USAGE ON SEQUENCE job_audit_id_seq TO worker_role;
GRANT INSERT,SELECT ON outbox TO worker_role;
GRANT SELECT,UPDATE ON outbox,job_slo,attachments,attachment_jobs TO dispatcher_role;
GRANT SELECT ON attachment_variants TO dispatcher_role;