Skip to content

Commit 73d5b17

Browse files
authored
Added metastore to databricks_grants (#1447)
1 parent 784c814 commit 73d5b17

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

catalog/resource_grants.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,27 +159,60 @@ var mapping = securableMapping{
159159
"table": {
160160
"MODIFY": true,
161161
"SELECT": true,
162+
163+
// v1.0
164+
"ALL_PRIVILEGES": true,
162165
},
163166
"view": {
164167
"SELECT": true,
165168
},
166169
"catalog": {
167170
"CREATE": true,
168171
"USAGE": true,
172+
173+
// v1.0
174+
"ALL_PRIVILEGES": true,
175+
"USE_CATALOG": true,
176+
"CREATE_SCHEMA": true,
169177
},
170178
"schema": {
171179
"CREATE": true,
172180
"USAGE": true,
181+
182+
// v1.0
183+
"ALL_PRIVILEGES": true,
184+
"USE_SCHEMA": true,
185+
"CREATE_TABLE": true,
186+
"CREATE_VIEW": true,
187+
"CREATE_FUNCTION": true,
188+
"CREATE_MATERIALIZED_VIEW": true,
173189
},
174190
"storage_credential": {
175191
"CREATE_TABLE": true,
176192
"READ_FILES": true,
177193
"WRITE_FILES": true,
194+
195+
// v1.0
196+
"ALL_PRIVILEGES": true,
197+
"CREATE_EXTERNAL_TABLE": true,
178198
},
179199
"external_location": {
180200
"CREATE_TABLE": true,
181201
"READ_FILES": true,
182202
"WRITE_FILES": true,
203+
204+
// v1.0
205+
"ALL_PRIVILEGES": true,
206+
"CREATE_EXTERNAL_TABLE": true,
207+
},
208+
"metastore": {
209+
// v1.0
210+
"CREATE_CATALOG": true,
211+
"CREATE_EXTERNAL_LOCATION": true,
212+
"CREATE_STORAGE_CREDENTIAL": true,
213+
"CREATE_SHARE": true,
214+
"CREATE_RECIPIENT": true,
215+
"CREATE_PROVIDER": true,
183216
},
184217
}
185218

docs/resources/grants.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ resource "databricks_grants" "some" {
187187
}
188188
```
189189

190+
## Metastore grants
191+
192+
You can grant `CREATE_CATALOG`, `CREATE_EXTERNAL_LOCATION`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_RECIPIENT`, and `CREATE_PROVIDER` privileges to [databricks_metastore](metastore.md) id specified in `metastore` attribute.
193+
190194
## Other access control
191195

192196
You can control Databricks General Permissions through [databricks_permissions](permissions.md) resource.

0 commit comments

Comments
 (0)