You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added macro grant_internal_share_read to apply select permissions on all tables and views
* added macro `create_internal_share` which will create a share which allows unsecured objects and grant reference usages on downstream databases
* updated macro `has_matching_nodes` to cater for line breaks in the arguments being passed in
* updated version of `dbt_utils` to 1.3.3
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,18 @@
1
1
# Data Engineers Snowflake DataOps Utils Project Changelog
2
2
This file contains the changelog for the Data Engineers Snowflake DataOps Utils project, detailing updates, fixes, and enhancements made to the project over time.
3
3
4
-
## v0.3.9 2024-06-10 - Grant Object For Procedures
4
+
## v0.3.10 - 2026-02-10 - Grant Shares
5
+
6
+
* added macro `grant_internal_share_read` to apply `select` permissions on all tables and views
7
+
* added macro `create_internal_share` which will create a share which allows unsecured objects and grant reference usages on downstream databases
8
+
* updated macro `has_matching_nodes` to cater for line breaks in the arguments being passed in
9
+
* updated version of `dbt_utils` to 1.3.3
10
+
11
+
## v0.3.9.1 2025-07-10 - Tag Doc Fix
12
+
13
+
* fixed issue hwhen
14
+
15
+
## v0.3.9 2025-06-10 - Grant Object For Procedures
5
16
6
17
* added macro `grant_procedure_usage` to enable the ability to grant usage of a stored procedure to a role
Copy file name to clipboardExpand all lines: macros/grants/grants.yml
+36-9Lines changed: 36 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,18 @@ version: 2
9
9
# - Set var('grants_dry_run', true) in a dbt invocation to log all statements without executing them for newly refactored macros
10
10
11
11
macros:
12
+
- name: grant_internal_share_read
13
+
description: Grants SELECT on all tables and views in all schemas of the target database to the specified share. Executes grant statements for each table and view found.
14
+
docs:
15
+
show: true
16
+
arguments:
17
+
- name: share_name
18
+
type: string
19
+
description: Name of the share to grant SELECT privileges to
20
+
- name: exclude_schemas
21
+
type: List[string]
22
+
description: List of schemas to exclude from granting
23
+
12
24
- name: grant_database_ownership
13
25
description: This macro grants ownership privileges to the specified rolename on the database.
14
26
docs:
@@ -61,16 +73,24 @@ macros:
61
73
62
74
63
75
- name: grant_object
64
-
description: This macro grants specific object permissions to specific roles.
76
+
description: |
77
+
Grants specified privileges on objects (TABLE, VIEW, SCHEMA, etc.) to the provided roles.
78
+
Handles both granting and revoking privileges based on current state, logging a summary of actions taken.
65
79
docs:
66
80
show: true
67
81
arguments:
68
82
- name: object_type
69
83
type: string
70
-
description: Type of the object eg- TABLE, VIEW, SCHEMA
84
+
description: Type of the object (e.g., TABLE, VIEW, SCHEMA)
71
85
- name: objects
72
86
type: List[string]
73
87
description: List of objects to apply the permission to (format = schema.object)
88
+
- name: grant_types
89
+
type: List[string]
90
+
description: List of privilege types to grant (e.g., SELECT, REFERENCES)
91
+
- name: grant_roles
92
+
type: List[string]
93
+
description: List of roles to grant privileges to
74
94
75
95
- name: grant_usage_to_application
76
96
description: This macro grants usage privileges on specific objects to a specific application role.
@@ -115,7 +135,9 @@ macros:
115
135
description: List of schemas to grant usage privileges on
116
136
117
137
- name: grant_privileges
118
-
description: This macro is an example of how to grant privileges across environments based on targets
138
+
description: |
139
+
Grants a bundle of privileges across environments based on target context.
140
+
Calls multiple grant macros for database, schema, and role management, orchestrating environment-specific grants.
119
141
docs:
120
142
show: true
121
143
arguments:
@@ -124,16 +146,18 @@ macros:
124
146
description: List of schemas which are domain specific that should be exposed
125
147
126
148
- name: grant_schema_monitor
127
-
description: This macro grants monitor privilege inside all schemas to the specified rolename.
149
+
description: |
150
+
Grants MONITOR privilege on all objects in all schemas to the specified roles, excluding any schemas listed.
151
+
Uses grant_schema_monitor_specific for per-schema operations and supports dry-run mode.
128
152
docs:
129
153
show: true
130
154
arguments:
131
155
- name: exclude_schemas
132
156
type: List[string]
133
157
description: List of schemas to exclude
134
158
- name: grant_roles
135
-
type: "List[string]"
136
-
description: Name of the roles to apply eg- ['READERS_PROD', 'ANALYST', 'OPS_SUPPORT']
159
+
type: List[string]
160
+
description: List of roles to apply (e.g., ['READERS_PROD', 'ANALYST', 'OPS_SUPPORT'])
137
161
138
162
- name: grant_schema_monitor_specific
139
163
description: This macro grants monitor privilege inside specific schemas to the specified rolename.
@@ -226,7 +250,10 @@ macros:
226
250
description: Specifies if to revoke current grants or not
227
251
228
252
- name: grant_share_read
229
-
description: This macro grants monitor privilege inside specific schemas to the specified rolename.
253
+
description: |
254
+
Grants SELECT on specified views to the provided shares, and optionally revokes unmanaged grants.
255
+
Handles both granting and revoking privileges for views in schemas, based on the view_names and grant_shares arguments.
256
+
Uses grant_share_read_specific_schema for per-schema operations.
230
257
docs:
231
258
show: true
232
259
arguments:
@@ -237,8 +264,8 @@ macros:
237
264
type: List[string]
238
265
description: List of shares to apply
239
266
- name: revoke_current_grants
240
-
type: "boolean"
241
-
description: Revoke current grants on the schemas
267
+
type: boolean
268
+
description: Whether to revoke unmanaged grants before applying new ones
242
269
243
270
- name: grant_share_read_specific_schema
244
271
description: This macro grants select permissions to the specified view for the shares provided.
Copy file name to clipboardExpand all lines: macros/shares/shares.yml
+23-4Lines changed: 23 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,35 @@ version: 2
2
2
3
3
macros:
4
4
- name: create_share
5
-
description: This macro grants creates a share and grants usage on the associated accounts
5
+
description: |
6
+
Creates or updates a Snowflake share and grants usage to specified accounts.
7
+
This macro is used to provision secure data sharing between Snowflake accounts.
8
+
It creates the share if it does not exist, and grants usage privileges to the target database and reference usage to additional databases for the listed accounts.
9
+
Only runs in specified environments.
6
10
docs:
7
11
show: true
8
12
arguments:
9
13
- name: share_name
10
14
type: string
11
-
description: Name of the share to be created or updated
15
+
description: The name of the share to be created or updated.
12
16
- name: accounts
13
-
description: List of accounts to grant usage on the share
14
17
type: List[string]
18
+
description: List of Snowflake accounts to grant usage on the share.
15
19
- name: environments
20
+
type: List[string]
21
+
description: List of environments in which the macro should run.
22
+
23
+
- name: create_internal_share
24
+
description: Creates or updates a Snowflake share, grants usage on the target database, and reference usage on additional databases. Only runs in specified environments.
25
+
docs:
26
+
show: true
27
+
arguments:
28
+
- name: share_name
16
29
type: string
17
-
description: The environments to include the share
30
+
description: Name of the share to be created or updated
31
+
- name: reference_databases
32
+
type: List[string]
33
+
description: List of databases to grant reference usage to the share
34
+
- name: environments
35
+
type: List[string]
36
+
description: List of environments in which the macro should run
0 commit comments