1
0
mirror of https://github.com/google/nomulus synced 2026-02-11 15:21:28 +00:00

Modify Cloud SQL user management scripts (#302)

* Modify Cloud SQL user management scripts

Create readonly and readwrite roles that may be granted to users.
Also configured default privileges for tables created in the future.

Made sure arbitrary users may not create database or tables.

* Modify Cloud SQL user management scripts

Create readonly and readwrite roles that may be granted to users.
Also configured default privileges for tables created in the future.

Made sure arbitrary users may not create database or tables.
This commit is contained in:
Weimin Yu
2019-10-09 16:02:42 -04:00
committed by GitHub
parent 906b054f4b
commit f2a2b2d2e2
6 changed files with 87 additions and 23 deletions

View File

@@ -14,9 +14,7 @@
--
-- Script to delete a user from the database.
REVOKE ALL PRIVILEGES ON DATABASE postgres FROM :username;
REVOKE ALL PRIVILEGES ON SCHEMA public FROM :username;
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM :username;
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public FROM :username;
REVOKE ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public FROM :username;
-- Ignore warnings like :username is not a member of role readonly/write.
REVOKE readonly FROM :username;
REVOKE readwrite FROM :username;
DROP USER :username;