Sub topic 13
Compute access modes and permission enforcement
Unity Catalog stores the permissions, but the compute that runs your query enforces them. A cluster in the wrong mode can fail to see Unity Catalog at all, refuse to read a protected table, or leave user code with more reach than you intended. This chapter covers which compute types enforce permissions, how the two Unity Catalog access modes differ, and which errors to expect.
It assumes you know GRANT and REVOKE, the securable hierarchy, and the row filters, column masks and dynamic views from the earlier chapters.
Two separate permission layers
Two kinds of permission apply when you run a query.
- Data permissions are the Unity Catalog privileges you already know:
USE CATALOG,USE SCHEMA,SELECTand so on. - Compute permissions control who can attach to, restart or manage a cluster, such as
CAN ATTACH TOandCAN MANAGE.
Having one does not give you the other. A user who can attach to a cluster still gets an error on a table they have no SELECT on. A user with SELECT still cannot run a query on a cluster they cannot attach to.
Unity Catalog checks data privileges at query time against the identity running the query. In a notebook that is you. In a job it is the identity the job runs as, often a service principal. On a dedicated cluster assigned to a group, it is the group's permissions (see below).
Which compute enforces Unity Catalog
Not every compute type enforces Unity Catalog permissions. Pick from this table.
| Compute | Enforces Unity Catalog? | Notes |
|---|---|---|
| SQL warehouse (serverless or pro) | Yes | Always enforces. Supports row filters, column masks and dynamic views. |
| Serverless compute for notebooks and jobs | Yes | Managed by Databricks. No access mode to choose. |
| Standard access mode cluster | Yes | Multi-user. Isolates users from each other. Previously called "shared". |
| Dedicated access mode cluster | Yes | Assigned to one user or one group. Previously called "single user". |
| No-isolation shared cluster | No | Cannot access Unity Catalog data. |
Databricks has renamed these modes over time. Older documentation and the cluster API still use USER_ISOLATION for standard, SINGLE_USER for dedicated, and NONE for no isolation.
How enforcement works
Unity Catalog permissions are only meaningful if the user cannot step around the check. Each mode handles this differently.
Standard access mode
Several users can share one standard cluster. Databricks isolates each user's code from other users and from the process that talks to storage. Your code never receives raw cloud credentials. Every data request goes through the engine, which asks Unity Catalog whether your identity may read the object, and which then applies any row filter or column mask before returning data.
Because the engine sits between you and the data, standard compute can safely apply dynamic views, row filters and column masks. The cost is a restricted programming surface. Some APIs and libraries that need low-level machine access are blocked or limited. Check the documentation for your runtime version before you move a workload.
Dedicated access mode
A dedicated cluster is assigned to a single user or to a single group. The code you run has fuller access to the cluster machines, which is why it supports more workloads, such as R and some machine learning libraries. That same freedom means the cluster cannot simply trust user code to respect a filter that is applied on the machine.
For tables with row filters or column masks, and for views and dynamic views, dedicated compute therefore depends on the runtime:
- Older runtimes: queries on those objects fail with an error. Table-level
SELECTon ordinary tables works. - Recent runtimes (Databricks Runtime 15.4 LTS and above): the filtering step is handed off to serverless compute behind the scenes, so the query works. This requires serverless compute to be available in your workspace, and the filtering work is billed as serverless usage.
Treat the exact runtime and billing details as things to confirm in the current documentation, since they change.
Dedicated compute assigned to a group
When a dedicated cluster is assigned to a group, the cluster runs with the group's permissions. Every member who attaches gets the group's access, not their own. This is useful for a team cluster with a shared service identity, but it has a trap: a user's individual grants are not used on that cluster. Grant the needed privileges to the group.
Checking what a cluster enforces
You can confirm who the engine thinks you are and what group membership it sees. The row filter and column mask functions from earlier chapters call is_account_group_member, so this is the identity they evaluate.
SELECT current_user() AS me,
is_account_group_member('pii_readers') AS can_see_email;
SELECT email FROM main.sales.customers LIMIT 5;On a standard cluster or SQL warehouse, a user outside pii_readers sees *** in the email column, because the mask from the column-mask chapter runs on the engine. On a dedicated cluster assigned to a group, current_user() returns the person running the notebook, but the privileges used are the group's. If the results surprise you, check the cluster's access mode and its assigned principal first.
Requiring an access mode with a cluster policy
Users can create clusters in the wrong mode. A cluster policy removes that choice. This policy allows only standard and dedicated modes, so nobody can create a no-isolation cluster.
{
"data_security_mode": {
"type": "allowlist",
"values": ["USER_ISOLATION", "SINGLE_USER"],
"defaultValue": "USER_ISOLATION"
}
}Set defaultValue to the mode you want most users to get. Policies are also the right place to cap cluster size and to force Unity Catalog compatible runtimes. Grant users CAN USE on the policy and remove their unrestricted cluster creation rights.
Common errors and what they mean
- Table or schema not found, but it exists in Unity Catalog. The cluster is probably in no-isolation mode, or its default catalog is
hive_metastore. Check the access mode and runSELECT current_catalog(). - A query on a view or filtered table fails on a dedicated cluster. The runtime is older than the version that supports serverless filtering, or serverless compute is not enabled. Move to a newer runtime or to standard compute.
- A group member gets different results on their own cluster and a team cluster. The team cluster runs as the group. Compare the group's grants with the person's grants.
PERMISSION_DENIEDonUSE CATALOGorUSE SCHEMA. This is a data permission problem, not a compute problem. RunSHOW GRANTSon the parent objects as in the grant chapter.- A library or API fails on standard compute only. The standard mode restricts low-level access. Either use a supported alternative or move that one workload to dedicated compute.
Decision criteria
- Choose SQL warehouses for BI and SQL analytics. They need no access mode decision and enforce every Unity Catalog control.
- Choose standard for shared interactive work and scheduled jobs that use supported APIs. It gives the strongest enforcement with the lowest cost per user.
- Choose dedicated only when a workload needs capabilities standard blocks. Keep these clusters small in number, and assign them to a group rather than a person so access does not depend on one account.
- Avoid no isolation for any work involving governed data.
Exercise
A data scientist belongs to the group pii_readers. On a standard cluster, the email column shows real addresses. On a dedicated cluster assigned to the group ml-team, which they also belong to, the same query shows ***. What is the most likely cause and the fix?
Show answer
The dedicated cluster runs with the permissions of ml-team, not the individual. ml-team is not a member of pii_readers, so the mask returns ***. Either add ml-team to pii_readers (if that group should see email addresses), or move the work to compute that runs as the user. Individual group membership does not carry over to a cluster assigned to a group.
Exercise
You want to guarantee that nobody in your workspace creates a cluster that cannot enforce Unity Catalog permissions. What do you configure, and which values do you allow for data_security_mode?
Show answer
Create a cluster policy that restricts data_security_mode to USER_ISOLATION (standard) and SINGLE_USER (dedicated), with a default of USER_ISOLATION, then give users CAN USE on that policy and remove their unrestricted cluster creation. This excludes NONE, the no-isolation mode.