snowplow / dbt-snowplow-utils

Snowplow utility functions to be used in conjunction with the snowplow-web dbt package.
Other
12 stars 6 forks source link

Feature/add apply grants #161

Closed rlh1994 closed 7 months ago

rlh1994 commented 7 months ago

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