feat(postgress): lab7 bootstrap least-privilege roles
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
-- +goose Up
|
||||
GRANT SELECT, INSERT ON users, chats, chat_members, messages, message_attachments TO lab_api;
|
||||
GRANT SELECT, INSERT, DELETE ON sessions, idempotency_keys TO lab_api;
|
||||
GRANT SELECT, INSERT, UPDATE ON attachments, outbox TO lab_api;
|
||||
GRANT SELECT ON attachment_variants TO lab_api;
|
||||
GRANT SELECT, UPDATE ON failed_jobs TO lab_api;
|
||||
|
||||
GRANT SELECT, UPDATE ON attachments TO lab_worker;
|
||||
GRANT INSERT ON attachment_variants, failed_jobs, outbox TO lab_worker;
|
||||
GRANT SELECT ON attachment_variants TO lab_worker;
|
||||
|
||||
GRANT SELECT, UPDATE ON attachments TO lab_reconciler;
|
||||
GRANT INSERT ON outbox TO lab_reconciler;
|
||||
|
||||
-- +goose Down
|
||||
REVOKE ALL ON users, chats, chat_members, messages, message_attachments, sessions,
|
||||
idempotency_keys, attachments, outbox, attachment_variants, failed_jobs FROM lab_api;
|
||||
REVOKE ALL ON attachments, attachment_variants, failed_jobs, outbox FROM lab_worker;
|
||||
REVOKE ALL ON attachments, outbox FROM lab_reconciler;
|
||||
Reference in New Issue
Block a user