Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grant schema access to <schema>_reader #237

Open
HomoCodens opened this issue Jan 19, 2021 · 1 comment
Open

grant schema access to <schema>_reader #237

HomoCodens opened this issue Jan 19, 2021 · 1 comment
Milestone

Comments

@HomoCodens
Copy link
Collaborator

Currently db admins need to grant all on schema <schema name> to <user name> for each individual user who needs to work with a specific schema.

Would it not be easier to grant schema access <schema>_reader (and thus _writer and _admin)? That way new users only need the grant to _reader, which they need anyway, and they are set.

Was there any reason why we did it the way we did?

@HomoCodens
Copy link
Collaborator Author

inst/sql/create_roles.sql

CREATE ROLE timeseries_reader NOLOGIN;
CREATE ROLE timeseries_writer NOLOGIN;
GRANT timeseries_reader TO timeseries_writer;

CREATE ROLE timeseries_access_public;
CREATE ROLE timeseries_access_main;
CREATE ROLE timeseries_access_restricted;
GRANT timeseries_access_public TO timeseries_access_main;
GRANT timeseries_access_main to timeseries_access_restricted;

CREATE ROLE timeseries_admin NOLOGIN;
GRANT timeseries_writer TO timeseries_admin;
GRANT timeseries_access_restricted TO timeseries_admin;
GRANT ALL ON SCHEMA timeseries TO timeseries_admin;

Well, I guess we do not want to grant ALL to readers but granting select to _reader and insert, update to _writer in this script should work.

@HomoCodens HomoCodens added this to the CRAN milestone Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant