vw_user_entitlements
Creates, updates, deletes, gets or lists a vw_user_entitlements resource.
Overview
| Name | vw_user_entitlements |
| Type | View |
| Id | databricks_workspace.iam.vw_user_entitlements |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace deployment name used to scope the query. |
id | string | Unique identifier for the workspace user. |
userName | string | Username of the workspace user. |
displayName | string | Human-readable display name of the workspace user. |
entitlement | string | Entitlement granted to the user (one row per entitlement, e.g. workspace-access, databricks-sql-access, allow-cluster-create). |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | Workspace deployment name used to scope the query. |
SELECT Examples
SELECT
deployment_name,
id,
userName,
displayName,
entitlement
FROM databricks_workspace.iam.vw_user_entitlements
WHERE deployment_name = '{{ deployment_name }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
u.deployment_name,
u.id,
u.userName,
u.displayName,
JSON_EXTRACT(e.value, '$.value') AS entitlement
FROM databricks_workspace.iam.users_v2 u,
JSON_EACH(u.entitlements) e
WHERE u.deployment_name = '{{ deployment_name }}'
SELECT
u.deployment_name,
u.id,
u.userName,
u.displayName,
e.value->>'value' AS entitlement
FROM databricks_workspace.iam.users_v2 u,
jsonb_array_elements(u.entitlements::jsonb) AS e
WHERE u.deployment_name = '{{ deployment_name }}'