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
[x] I have verified that these changes work locally
[ ] I have updated the README.md (if applicable)
[ ] I have added tests & descriptions to my models (and macros if applicable)
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