vw_workspace_access_details
Creates, updates, deletes, gets or lists a vw_workspace_access_details resource.
Overview
| Name | vw_workspace_access_details |
| Type | View |
| Id | databricks_workspace.iamv2.vw_workspace_access_details |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace deployment name used to scope the query. |
principal_id | string | Unique identifier of the principal whose workspace access is being queried. |
principal_type | string | Type of the principal (e.g. USER, GROUP, SERVICE_PRINCIPAL). |
access_type | string | How the principal was granted access to the workspace (e.g. DIRECT, ACCOUNT_ADMIN). |
status | string | Current access status of the principal on the workspace (e.g. ACTIVE). |
account_id | string | Databricks account ID that owns the workspace. |
workspace_id | integer | Numeric identifier of the workspace. |
permission | string | Permission level granted to the principal on the workspace (one row per permission, e.g. USER, ADMIN). |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace deployment name used to scope the query. |
principal_id | string | Unique identifier of the principal whose workspace access is being queried. |
SELECT Examples
SELECT
deployment_name,
principal_id,
principal_type,
access_type,
status,
account_id,
workspace_id,
permission
FROM databricks_workspace.iamv2.vw_workspace_access_details
WHERE deployment_name = '{{ deployment_name }}'
AND principal_id = '{{ principal_id }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
wa.deployment_name,
wa.principal_id,
wa.principal_type,
wa.access_type,
wa.status,
wa.account_id,
wa.workspace_id,
p.value AS permission
FROM databricks_workspace.iamv2.workspace_iam_v2 wa,
JSON_EACH(wa.permissions) p
WHERE wa.deployment_name = '{{ deployment_name }}'
AND wa.principal_id = '{{ principal_id }}'
SELECT
wa.deployment_name,
wa.principal_id,
wa.principal_type,
wa.access_type,
wa.status,
wa.account_id,
wa.workspace_id,
p.value AS permission
FROM databricks_workspace.iamv2.workspace_iam_v2 wa,
jsonb_array_elements(wa.permissions::jsonb) AS p
WHERE wa.deployment_name = '{{ deployment_name }}'
AND wa.principal_id = '{{ principal_id }}'