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

feat: add GRANT ... ON ALL TABLES IN ... #1626

Merged
merged 6 commits into from
Mar 24, 2023

Conversation

Relativity74205
Copy link
Contributor

In an number of issues, the snowflake feature GRANT SELECT ON ALL TABLES ... (or similar) is requested. I created a prototype of this feature in this branch. Currently it only works for the table resource (not for others).

Before I finish this work (add unit and acceptance tests, implement it on other resources, etc.) I would like to have an opinion if this feature makes sense. Not only how it was implemented, but also generally. Because:

When running e.g. GRANT SELECT ON ALL TABLES IN ..., then Snowflake creates a grant for each individual existing table and there is no way to attribute existing table grants to a GRANT SELECT ON ALL TABLES grant. Thus they cannot be checked (or removed).

Test Plan

tbd

  • acceptance tests

References

#787
#250
#284

@sfc-gh-swinkler
Copy link
Collaborator

@Relativity74205 this is very good. I like this a lot. I think i will merge this, get the tests working, and it should be good to go.

@sfc-gh-swinkler sfc-gh-swinkler marked this pull request as ready for review March 24, 2023 17:57
@sfc-gh-swinkler sfc-gh-swinkler merged commit 505a5f3 into Snowflake-Labs:main Mar 24, 2023
@Relativity74205
Copy link
Contributor Author

Relativity74205 commented Mar 24, 2023

@sfc-gh-swinkler Thanks for the review and acceptance. :) Please notify me, if I can assist in getting the tests to work.

@sfc-gh-swinkler
Copy link
Collaborator

@Relativity74205 your code was pretty good as it was, and i didn't have to make too many changes. Its currently released as part of 0.60. Thank you so much!

@TerjeRusska
Copy link

@Relativity74205 Awesome feature, I've been looking for this for quite a few months 😄 Dropped my resource count from table level 4096 to schema level 106 🎉

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.

4 participants