Skip to content

[CT-1346] [Feature] Extend grants config to include usage grants #6063

@AlexFrid

Description

@AlexFrid

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

#5189 and #5263 introduced grants as node configs.

This feature request seeks to extend the grants config to include usage grants as well.

Currently, we can do this:

models:
  +grants:
    select: ['reporter', 'bi']

The extended version could look very similar:

models:
  +grants:
    select: ['reporter', 'bi']
    warehouse: ['transform']
    database: ['prod']
    schema: ['analytics']

or

models:
  +grants:
    select: ['reporter', 'bi']
    usage:
      - warehouse: ['transform']
      - database: ['prod']
      - schema: ['analytics']

Describe alternatives you've considered

The current recommended way of doing usage grants is by using on-run-end
Example:

on-run-end:
  - "{% for schema in schemas %}grant usage on schema {{ schema }} to group reporter; {% endfor %}"

A similar approach is also in the dbt labs partner engineering team demos)

Who will this benefit?

This will benefit the same people who appreciate grants as node configs and push the envelope further in terms of how dbt can enable people to configure grants.

As select grants are often used in conjunction with usage grants, this will allow people to consolidate their workflow to fully use the grants config for standard things, instead of having it fragmented between the grants config for select grants and on-run-end for usage grants.

The dbt labs partner engineering team noticed that this would be useful as we updated our demos and enablement recommendations to use the grants config, but couldn't fully replace our current macro since we are using usage grants.

@ernestoongaro has also noticed people asking about this.

Are you interested in contributing this feature?

Yes

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    RefinementMaintainer input neededTeam:AdaptersIssues designated for the adapter area of the codeenhancementNew feature or requeststaleIssues that have gone stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions