Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description & motivation
Adds the ability to overwrite the default dbt macro for grants to also use the
snowplow__grants_list
variable to grant select on all the tables created. Also adds a post hook that we can add to our packages to grant usages on any created schemas.I have tested this works as expected, although does require case-sensitive roles/users, on Snowflake, Databricks, and Redshift. Bigquery will not be supported due to their weird grant system.
The variable will ensure that it's scope will only grant tables at it's scope (e.g. scoped to a package, will only grant those in a package). However, the schema grants will apply to any schemas written to, I will make this clear in the docs.
I haven't added tests because without adding multiple users it's not really possible, we'll have to manually test changes to this if they occur.
Checklist