Skip to content

Add macros to grant roles access to schemas and tables#30

Open
brendagutman wants to merge 10 commits into
mainfrom
feature/bg/dev_grants
Open

Add macros to grant roles access to schemas and tables#30
brendagutman wants to merge 10 commits into
mainfrom
feature/bg/dev_grants

Conversation

@brendagutman

@brendagutman brendagutman commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Add macros to grant roles access to schemas and tables

  • Macros were added that will automatically run after new schemas are created, which will grant permissions to defined developer roles.
  • A macro was added to allow easy permission granting for new users.
  • Macro documentation was added to the _macros.yml
  • The dbt_profiles.yml file was updated to implement the dev macros.
  • An ADR was added to describe the design strategy.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

@a-l-holmes and I ran dbt models using the code and were given permissions.
Permissions checked via sql query.

Checklist

  • I ensured that all tables have proper source and ref definitions
  • I Defined {{ config(schema=[schema name], tags = [list, of, tags]) }} at
    the start of each script
  • I have performed a self-review of my own code
  • I have checked my code and corrected any misspellings
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature
    works
  • My code follows the style guidelines of this project
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have committed any related changes to the PR
  • Run sqlfluff fix on tables that are created or modified in this PR.

@brendagutman brendagutman changed the title Add an 'on-run-end' process to grant schema and table access at runtime Add macros to grant roles access to schemas and tables Jun 4, 2026
@brendagutman
brendagutman force-pushed the feature/bg/dev_grants branch from a6d4113 to 556fe0f Compare June 4, 2026 20:33
@brendagutman
brendagutman marked this pull request as ready for review June 4, 2026 20:47

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES why not GRANT ALL ON ALL TABLES

@brendagutman

Copy link
Copy Markdown
Contributor Author

Before using this method of granting permissions to warehouse objects, I'd like to get feedback from those who know more about our warehouse security procedures. I'd like to ensure this method will not be short circuiting process' we rely on for data security.

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