mirror of
https://github.com/google/nomulus
synced 2026-01-05 13:07:04 +00:00
Restrict nomulus user access to flyway table (#297)
* Restrict nomulus user access to flyway table The regular read-write user should not have write permissions to the flyway metadata table.
This commit is contained in:
@@ -12,10 +12,12 @@
|
|||||||
-- See the License for the specific language governing permissions and
|
-- See the License for the specific language governing permissions and
|
||||||
-- limitations under the License.
|
-- limitations under the License.
|
||||||
--
|
--
|
||||||
-- Script to create a user with read-write permission to all tables.
|
-- Script to create a user with read-write permission to all tables (except for
|
||||||
|
-- WRITE permissions to flyway_schema_history).
|
||||||
|
|
||||||
CREATE USER :username ENCRYPTED PASSWORD :'password';
|
CREATE USER :username ENCRYPTED PASSWORD :'password';
|
||||||
GRANT CONNECT ON DATABASE postgres TO :username;
|
GRANT CONNECT ON DATABASE postgres TO :username;
|
||||||
GRANT USAGE ON SCHEMA public TO :username;
|
GRANT USAGE ON SCHEMA public TO :username;
|
||||||
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO :username;
|
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO :username;
|
||||||
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO :username;
|
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO :username;
|
||||||
|
REVOKE INSERT, UPDATE, DELETE ON TABLE public.flyway_schema_history FROM :username;
|
||||||
|
|||||||
Reference in New Issue
Block a user