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

[ADAP-474] [Feature] Accept users, groups, or roles in grants config on resource #415

Open
2 tasks done
stevenayers-tvx opened this issue Apr 21, 2023 · 7 comments · May be fixed by #626
Open
2 tasks done

[ADAP-474] [Feature] Accept users, groups, or roles in grants config on resource #415

stevenayers-tvx opened this issue Apr 21, 2023 · 7 comments · May be fixed by #626
Labels
enhancement New feature or request grants Issues related to dbt's grants functionality refinement Product or leadership input needed

Comments

@stevenayers-tvx
Copy link

Is this a new bug in dbt-redshift?

  • I believe this is a new bug in dbt-redshift
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

After specifically creating the group finance_department in Redshift, I cannot use it as a grantee in the grant config.

I can see the group when I run SELECT * FROM pg_group

models:
  - name: specific_model
    config:
      grants:
        select: ['finance_department']

Error: user "finance_department" does not exist

Expected Behavior

Grantee syntax says groups, not just users, should be accepted: https://docs.getdbt.com/reference/resource-configs/grants#common-syntax

Steps To Reproduce

  1. Create a group in redshift
  2. Add to a grants config on a model

Relevant log output

No response

Environment

- OS:
- Python:
- dbt-core:
- dbt-redshift:

Additional Context

No response

@stevenayers-tvx stevenayers-tvx added bug Something isn't working triage labels Apr 21, 2023
@github-actions github-actions bot changed the title [Bug] Grants config on resource does not work on groups [ADAP-474] [Bug] Grants config on resource does not work on groups Apr 21, 2023
@stevenayers-tvx stevenayers-tvx changed the title [ADAP-474] [Bug] Grants config on resource does not work on groups [ADAP-474] [Bug] Grants config on resource does not accept pg_groups Apr 21, 2023
@dbeatty10
Copy link
Contributor

Thanks for following up @stevenayers-tvx !

Only granting to (and revoking from) Redshift users was explicitly covered in the original implementation of grants in #131 -- granting/revoking for Redshift groups and roles was not.

This deserves clarification in the docs, and I've opened dbt-labs/docs.getdbt.com#3245 accordingly.

I'm going to convert this into a feature request to add support for grants for Redshift groups and roles.

@dbeatty10 dbeatty10 added enhancement New feature or request refinement Product or leadership input needed and removed bug Something isn't working triage labels Apr 21, 2023
@dbeatty10 dbeatty10 changed the title [ADAP-474] [Bug] Grants config on resource does not accept pg_groups [ADAP-474] [Feature] Accept users, groups, or roles in grants config on resource Apr 22, 2023
dbeatty10 added a commit to dbt-labs/docs.getdbt.com that referenced this issue Apr 25, 2023
[Preview](https://deploy-preview-3245--docs-getdbt-com.netlify.app/reference/resource-configs/grants#database-specific-requirements-and-notes)
> click "Redshift" tab

## What are you changing in this pull request and why?
Redshift has users, groups, and roles. But the grants functionality only
fully supports users (and not groups or roles).

See dbt-labs/dbt-redshift#415 for more
context.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

---------

Co-authored-by: mirnawong1 <89008547+mirnawong1@users.noreply.github.com>
@amardatar
Copy link

We use this extensively, and intentional or not it seems that just using group <group_name> works perfectly fine. @stevenayers-tvx does it work if you just do this?

models:
  - name: specific_model
    config:
      grants:
        select: ['group finance_department']

Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Dec 31, 2023
Copy link
Contributor

github-actions bot commented Jan 7, 2024

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 31, 2024
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
@joellabes
Copy link

Reopening as the PR that relates to it is still open

@joellabes joellabes reopened this Dec 17, 2024
@github-actions github-actions bot removed the Stale label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request grants Issues related to dbt's grants functionality refinement Product or leadership input needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants