Skip to main content

share_permissions

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

Overview

Nameshare_permissions
TypeResource
Iddatabricks_workspace.sharing.share_permissions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
next_page_tokenstring
privilege_assignmentsarrayThe privileges assigned to each principal

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectname, deployment_namemax_results, page_tokenGets the permissions for a data share from the metastore. The caller must have the USE_SHARE privilege
updateupdatename, deployment_nameUpdates the permissions for a data share in the metastore. The caller must have both the USE_SHARE and

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)
namestringThe name of the share.
max_resultsintegerMaximum number of permissions to return. - when set to 0, the page length is set to a server configured value (recommended); - when set to a value greater than 0, the page length is the minimum of this value and a server configured value; - when set to a value less than 0, an invalid parameter error is returned; - If not set, all valid permissions are returned (not recommended). - Note: The number of returned permissions might be less than the specified max_results size, even zero. The only definitive indication that no further permissions can be fetched is when the next_page_token is unset from the response.
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

Gets the permissions for a data share from the metastore. The caller must have the USE_SHARE privilege

SELECT
next_page_token,
privilege_assignments
FROM databricks_workspace.sharing.share_permissions
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;

UPDATE examples

Updates the permissions for a data share in the metastore. The caller must have both the USE_SHARE and

UPDATE databricks_workspace.sharing.share_permissions
SET
changes = '{{ changes }}',
omit_permissions_list = {{ omit_permissions_list }}
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
privilege_assignments;