linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Set appropriate DB users for the docker image #141

Closed SPlanzer closed 4 years ago

SPlanzer commented 4 years ago

User Story

The docker image is for the purpose of development and testing. This image must provide the required DB users for testing the gazetteer application.

There are four users for this app

Acceptance Criteria

Docker needs to deploy users with access to these roles so that dev and testing via the QGIS gazetteer app can use them. This will require ensuring they are allocated to the correct DB group

Additional context

What access privileges should each users have?

There are two functions for validating users in the app:

This view is populated as below.

Takeaways are:

https://github.com/linz/gazetteer/blob/ec7caa01bf19aa49521c1c93acf3355954819d8c/src/sql/gazetteer_add_user.sql#L67-L90

CREATE ROLE gazetteer_admin
  NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
GRANT gazetteer_user TO gazetteer_admin;
CREATE ROLE gazetteer_dba
  NOSUPERUSER INHERIT NOCREATEDB CREATEROLE;
GRANT gaz_owner TO gazetteer_dba;
GRANT gaz_web_admin TO gazetteer_dba;
GRANT gazetteer_admin TO gazetteer_dba;

These below roles may also be required for testing?


CREATE ROLE gazetteer_export
  NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
CREATE ROLE gazetteer_user
  NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE;
CREATE ROLE gaz_owner
  NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE;