Skip to content

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

Merged
brendagutman merged 14 commits into
mainfrom
feature/bg/dev_grants
Jul 24, 2026
Merged

Add macros to grant roles access to schemas and tables#30
brendagutman merged 14 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?

dbt compile - successful
dbt show --select path:analyses/grants/check_schema_role_privileges.sql - expected results for freshly generated schema and tables

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
Comment thread dbt_project/macros/_macros.yml
@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.

@brendagutman

Copy link
Copy Markdown
Contributor Author

@chris-s-friedman I added a few files since you looked at this last. They are to help someone troubleshoot/check permissions. analysis/grants

@brendagutman
brendagutman merged commit 549e21a into main Jul 24, 2026
1 check passed
@brendagutman
brendagutman deleted the feature/bg/dev_grants branch July 24, 2026 16:47
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