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

Add Copy Grants to Options in Table and View Materialization's #1744

Closed
Carolus-Holman opened this issue Sep 12, 2019 · 3 comments
Closed

Add Copy Grants to Options in Table and View Materialization's #1744

Carolus-Holman opened this issue Sep 12, 2019 · 3 comments
Labels
enhancement New feature or request snowflake

Comments

@Carolus-Holman
Copy link
Contributor

Carolus-Holman commented Sep 12, 2019

Add Copy Grants to View and Table Config Statement

Typically with Snowflake Tables and Views we use a Copy Grants switch to maintain grants on current View and Tables in Snowflake. Adding this will alleviate some of the Post-Hook commands to add Grants to existing objects. If the object has no grants this is ignored by snowflake.

Alternative Approach using Post-Hooks

Adding Post-Hook Events to Re-Apply Grants. grant select on table to role myrole

Snowflake Feature Only

This feature is for the Snowflake Adapter only. If developers are not responsible for maintaining security (as in roles, as we should all be thinking about security) this would alleviate additional work by the Administrator by maintaining the current security on the object

Benefits?

This will benefit Developers and Admins when maintaining current access permissions to an object. Also it will help to create objects that need to maintain roles and are re-initialized outside of DBT. The Copy Grants switch will be present in the DDL of the Snowflake object when viewing the source through the GET_DDL command or viewing the View source.

Sample Code Output

CREATE OR REPLACE View myView /* Added Copy Grants Here */ COPY GRANTS as ( Select 1 as Id );

@Carolus-Holman Carolus-Holman added enhancement New feature or request triage labels Sep 12, 2019
@drewbanin
Copy link
Contributor

Hey @Carolus-Holman - cool idea! How do you imagine that grants will be added to these tables/views initially? Is that a manual process? And what happens for net-new models -- those will be created without any grants at all, right?

I think dbt users should be able to administrate permissions on their tables/views however they'd like, so I'm happy to add this functionality to dbt. I also think it might lead to some pretty confusing permissions issues! In particular, I wonder how this will work with dev/staging/prod envs -- does your workflow for setting grants encompass setting grants appropriately in all of these different environments?

@Carolus-Holman
Copy link
Contributor Author

Carolus-Holman commented Sep 12, 2019 via email

@drewbanin
Copy link
Contributor

fixed by #1747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request snowflake
Projects
None yet
Development

No branches or pull requests

2 participants