Skip to main content

dbsql_permissions

Creates, updates, deletes, gets or lists a dbsql_permissions resource.

Overview

Namedbsql_permissions
TypeResource
Iddatabricks_workspace.sql.dbsql_permissions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
object_idstringAn object's type and UUID, separated by a forward slash (/) character.
access_control_listarray
object_typestringA singular noun object type. (alert, dashboard, data_source, query)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectobject_type.value, object_id, object_type, deployment_nameGets a JSON representation of the access control list (ACL) for a specified object.
setinsertobject_type.value, object_id, deployment_name, object_typeSets the access control list (ACL) for a specified object. This operation will complete rewrite the
transfer_ownershipexecobject_type.value, object_id, deployment_name, object_typeTransfers 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.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
object_idobjectThe ID of the object on which to change ownership.
object_typestringThe type of object permissions to check.
object_type.valuestring

SELECT examples

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

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
;

Lifecycle Methods

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 }}"
}'
;