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

Feature/add apply grants #161

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

rlh1994
Copy link
Contributor

@rlh1994 rlh1994 commented Feb 6, 2024

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

  • 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)

@rlh1994 rlh1994 force-pushed the feature/add-apply-grants branch 5 times, most recently from 72a1579 to 97afe2b Compare February 15, 2024 12:36
@rlh1994 rlh1994 marked this pull request as ready for review February 15, 2024 12:38
@rlh1994 rlh1994 requested a review from a team as a code owner February 15, 2024 12:38
@georgewoodhead georgewoodhead changed the base branch from main to release/snowplow-utils/0.16.2 February 15, 2024 16:13
@rlh1994 rlh1994 force-pushed the feature/add-apply-grants branch from 97afe2b to 168cccf Compare February 15, 2024 18:02
@rlh1994 rlh1994 force-pushed the feature/add-apply-grants branch from 168cccf to 8d8d0da Compare February 21, 2024 15:47
Copy link
Contributor

@agnessnowplow agnessnowplow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rlh1994 rlh1994 merged commit 8c149dc into release/snowplow-utils/0.16.2 Feb 21, 2024
4 checks passed
@rlh1994 rlh1994 deleted the feature/add-apply-grants branch February 21, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants