dbsql_permissions
Creates, updates, deletes, gets or lists a dbsql_permissions resource.
Overview
| Name | dbsql_permissions |
| Type | Resource |
| Id | databricks_workspace.sql.dbsql_permissions |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
object_id | string | An object's type and UUID, separated by a forward slash (/) character. |
access_control_list | array | |
object_type | string | A singular noun object type. (alert, dashboard, data_source, query) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | object_type.value, object_id, object_type, deployment_name | Gets a JSON representation of the access control list (ACL) for a specified object. | |
set | insert | object_type.value, object_id, deployment_name, object_type | Sets the access control list (ACL) for a specified object. This operation will complete rewrite the | |
transfer_ownership | exec | object_type.value, object_id, deployment_name, object_type | Transfers ownership of a dashboard, query, or alert to an active user. Requires an admin API key. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
object_id | object | The ID of the object on which to change ownership. |
object_type | string | The type of object permissions to check. |
object_type.value | string |
SELECT examples
- get
Gets a JSON representation of the access control list (ACL) for a specified object.
SELECT
object_id,
access_control_list,
object_type
FROM databricks_workspace.sql.dbsql_permissions
WHERE object_type.value = '{{ object_type.value }}' -- required
AND object_id = '{{ object_id }}' -- required
AND object_type = '{{ object_type }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- set
- Manifest
Sets the access control list (ACL) for a specified object. This operation will complete rewrite the
INSERT INTO databricks_workspace.sql.dbsql_permissions (
object_type,
access_control_list,
object_type.value,
object_id,
deployment_name
)
SELECT
'{{ object_type }}' /* required */,
'{{ access_control_list }}',
'{{ object_type.value }}',
'{{ object_id }}',
'{{ deployment_name }}'
RETURNING
object_id,
access_control_list,
object_type
;
# Description fields are for documentation purposes
- name: dbsql_permissions
props:
- name: object_type.value
value: "{{ object_type.value }}"
description: Required parameter for the dbsql_permissions resource.
- name: object_id
value: "{{ object_id }}"
description: Required parameter for the dbsql_permissions resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the dbsql_permissions resource.
- name: object_type
value: "{{ object_type }}"
description: |
The type of object permission to set.
- name: access_control_list
description: |
:returns: :class:`SetResponse`
value:
- group_name: "{{ group_name }}"
permission_level: "{{ permission_level }}"
user_name: "{{ user_name }}"
Lifecycle Methods
- transfer_ownership
Transfers ownership of a dashboard, query, or alert to an active user. Requires an admin API key.
EXEC databricks_workspace.sql.dbsql_permissions.transfer_ownership
@object_type.value='{{ object_type.value }}' --required,
@object_id='{{ object_id }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"object_type": "{{ object_type }}",
"new_owner": "{{ new_owner }}"
}'
;