Let’s Get Certified
Module 21 / 21 · Governance

Access control

Follow a privilege from catalog to table. Apply row filters, column masks, and governed tags to limit what different groups can see.

Three access control systems

Access is controlled at three levels, each with its own system. Most of this module is about the third one, Unity Catalog privileges on data.

LevelObjectsSystem
AccountUsers, groups, service principals, workspacesAccount roles (account admin, service principal manager/user...), apply across all workspaces
WorkspaceNotebooks, folders, clusters, jobs, SQL warehouses, dashboardsWorkspace object ACLs (Can View, Can Run, Can Edit, Can Manage...)
DataCatalogs, schemas, tables, views, volumes, functions, modelsUnity Catalog privileges (GRANT / REVOKE)

Privilege model

  • Privileges are granted on a securable (catalog, schema, table, volume, function, external location...) to a principal (user, group, service principal).
  • Privileges inherit downward: SELECT granted on a catalog applies to all current and future tables in all its schemas.
  • To use an object you also need access to its parents: USE CATALOG on the catalog and USE SCHEMA on the schema.
  • Owners and metastore admins can grant. Users with MANAGE on an object can grant on it too.
Minimum privileges to read a table

USE CATALOG on the catalog + USE SCHEMA on the schema + SELECT on the table (or on the schema/catalog). Missing USE CATALOG is the classic reason a user with SELECT still gets "permission denied".

Common privileges

PrivilegeAllows
USE CATALOG, USE SCHEMATraverse into the catalog/schema (no data access by itself)
BROWSESee object metadata in Catalog Explorer and search without data access
SELECTRead a table or view
MODIFYInsert, update, delete, merge data in a table
CREATE SCHEMA, CREATE TABLE, CREATE VOLUME, CREATE FUNCTION, CREATE MATERIALIZED VIEWCreate child objects
READ VOLUME, WRITE VOLUMERead or write files in a volume
EXECUTECall a function or use a model
REFRESHRefresh a materialized view or streaming table
MANAGEManage privileges and ownership on the object without owning it
ALL PRIVILEGESAll applicable privileges (except MANAGE-type admin rights)
READ FILES, WRITE FILES, CREATE EXTERNAL TABLEOn external locations
No INSERT, UPDATE or DELETE privilege

Some slides list INSERT, UPDATE and DELETE as Unity Catalog privileges. They are not: one MODIFY privilege covers insert, update, delete and merge.

GRANT, REVOKE, SHOW GRANTS

GRANT USE CATALOG ON CATALOG prod TO `analysts`;
GRANT USE SCHEMA, SELECT ON SCHEMA prod.sales TO `analysts`;
GRANT MODIFY ON TABLE prod.sales.orders TO `etl-sp`;          -- service principal (by application ID or name)
GRANT CREATE TABLE ON SCHEMA prod.sales TO `data-eng`;
REVOKE SELECT ON SCHEMA prod.sales FROM `analysts`;
SHOW GRANTS ON TABLE prod.sales.orders;
SHOW GRANTS `analysts` ON SCHEMA prod.sales;
ALTER TABLE prod.sales.orders SET OWNER TO `data-eng`;

Principals with special characters (hyphens, @) are quoted in backticks. In the UI: Catalog Explorer, select the object, Permissions tab, Grant.

What about DENY?

Read this carefully

The exam guide lists GRANT, REVOKE and DENY. In Unity Catalog, the documented model is grant-only: there is no DENY statement, and access is removed by REVOKE or by not granting it. DENY exists in the legacy Hive metastore table access control (the hive_metastore catalog), where an explicit deny overrides grants. Fine-grained restriction in Unity Catalog uses row filters, column masks and ABAC policies. The official sample question offers "set a DENY permission on the column" as a wrong answer for masking. I could not confirm whether Databricks has added a Unity Catalog DENY since; check the current Manage privileges documentation before your exam.

Row filters and column masks

Both are SQL UDFs attached to a table. They run on every query, for every user, so one table serves everyone with different visibility. Membership checks use is_account_group_member('group') (account-level groups). current_user() returns the user's email.

-- Row filter: admins see all rows, others only US rows
CREATE FUNCTION prod.sec.us_only(region STRING)
RETURN IF(is_account_group_member('admins'), TRUE, region = 'US');
ALTER TABLE prod.sales.orders SET ROW FILTER prod.sec.us_only ON (region);
ALTER TABLE prod.sales.orders DROP ROW FILTER;

-- Column mask: only finance_team sees full card numbers
CREATE FUNCTION prod.sec.mask_card(card STRING)
RETURN CASE WHEN is_account_group_member('finance_team') THEN card
            ELSE concat('****-****-****-', right(card, 4)) END;
ALTER TABLE prod.sales.payments ALTER COLUMN credit_card_number SET MASK prod.sec.mask_card;
ALTER TABLE prod.sales.payments ALTER COLUMN credit_card_number DROP MASK;

Older alternative: dynamic views, a view with CASE WHEN is_account_group_member(...) logic, granting users access to the view only.

ABAC policies New exam

Attribute-based access control scales row filters and column masks. Instead of attaching a function to each table, you:

  1. Tag data with governed tags (e.g. column tag pii = ssn, table tag sensitivity = high). Governed tags have controlled allowed values and who may assign them.
  2. Write a policy once at the catalog, schema or table level that says: for these principals (except these), on tables/columns matching these tag conditions, apply this row filter or column mask function.
  3. Every current and future table matching the tags is protected automatically, inherited down the hierarchy.
-- illustrative syntax; check the docs for the exact form
CREATE POLICY mask_ssn
ON CATALOG prod
COLUMN MASK prod.sec.mask_ssn
TO `account users` EXCEPT `hr_admins`
FOR TABLES
MATCH COLUMNS has_tag_value('pii', 'ssn') AS ssn_col
ON COLUMN ssn_col;
Table-level row filter / column maskABAC policy
Applied toOne table/column at a timeAll matching objects under a catalog/schema, by tags
New tablesMust be protected manuallyProtected automatically once tagged
Best forA few specific tablesCentral, scalable governance of sensitive data

Other access controls

These are the non-data controls from the workspace level of the first table:

  • Workspace object ACLs: notebooks and folders (Can Read, Can Run, Can Edit, Can Manage), clusters, jobs, pipelines, SQL warehouses (Can Use, Can Manage), dashboards.
  • Secret scope ACLs: READ, WRITE, MANAGE.
  • Entitlements: workspace access, Databricks SQL access, cluster creation.

Trace an access request

A new group has SELECT on a table in a production schema. Its members still cannot read it. List the additional namespace privileges to check.

Check your reasoning

Check USE CATALOG on the containing catalog and USE SCHEMA on the containing schema. Grant the missing privileges to the group and verify the underlying table grant.

Product reference

Access control in Unity Catalog in the Databricks documentation

Knowledge check

Access control quiz

Answer 5 questions. Check each answer for an explanation.