Created
February 22, 2018 06:15
-
-
Save sgraham785/ab10353b13b3e5114acf3d7b0ef4bd9b to your computer and use it in GitHub Desktop.
Postgres DB Permissions example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--ACCESS DB | |
REVOKE CONNECT ON DATABASE nova FROM PUBLIC; | |
GRANT CONNECT ON DATABASE nova TO user; | |
--ACCESS SCHEMA | |
REVOKE ALL ON SCHEMA public FROM PUBLIC; | |
GRANT USAGE ON SCHEMA public TO user; | |
--ACCESS TABLES | |
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM PUBLIC ; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only ; | |
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO read_write ; | |
GRANT ALL ON ALL TABLES IN SCHEMA public TO admin ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OP