-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-3088] [Feature] Automatically grant usage on schema #8586
Comments
@aBBDnGus are you using Snowflake? Is so, I feel that this is already covered in dbt-labs/dbt-snowflake#715. I do agree that we should address this! My suggestion is that we first solve this within the context Snowflake, then upstream the solution into something more general. One question I have (perhaps you can help me here)
For 1, my hunch is that this
For 2, I'd love to get some input from users as to how to use grants in combination with principle of least privilege. |
I'm using PostgreSQL. For 1: I think, this is not a major problem to many users. It arises only when using multiple schemas and rights management (i.e. maintain application specific tool accounts which have access to specific models). Even then, one can circumvent this by manually granting the usage when a new schema is created. For 2: In my opinion, it is the best solution to grant usage on a schema to all users which have access to one of the contained models. The dbt process creates schemas automatically, but it does not grant access. |
I think some of the limitation here is that dbt doesn't have a first-class construct for defining & configuring The proposal in this issue is actually closer to dbt's current behavior: If a model needs to land in That's more or less what Doug & I cooked up for the over-clever approach here: https://docs.getdbt.com/blog/configuring-grants#option-b-too-clever-by-half |
adding @chwiese's take from an internal Slack thread
I agree that implementation depends on whether or not dbt formally manages schemas and database objects, or if they remain as they are today as effectively attributes of models |
We have solved the original problem in the meantime with setting
The advisory lock prevents that the command is executed on the same schema for multiple times and the error |
I ran into this recently while using |
+1
|
+1 |
2 similar comments
+1 |
+1 |
Is this your first time submitting a feature request?
Describe the feature
In dbt, one can specify which user has access to a model via
grants = {'select': ['user']}
. But the user can only access a view, if it is also granted usage to the schema where the model is located.Currently, one has to do this via a post-hook, e.g.
grant usage on schema {{ model.schema }} to {{ model.config.grants.select|join(', ') }}
.Unfortunately, this makes it impossible to parallelize the processes with
threads
, because the post-hook is applied concurrently on the same schema and the errortuple concurrently updated
appears.Describe alternatives you've considered
threads: 1
Who will this benefit?
More complex model structures, including multiple schemas and users.
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: