Privileges & GRANT
Databricks · Unity Catalog & Governance
Theory
Unity Catalog permissions use standard SQL: GRANT privilege ON object TO principal, and REVOKE to remove it. Principals are users, groups and service principals; granting to groups is best practice. Privileges are inherited downward: a grant on a catalog applies to every current and future schema and table in it. To read a table a user needs USE CATALOG on the catalog, USE SCHEMA on the schema and SELECT on the table (or on the schema or catalog).
Common privileges: SELECT (read), MODIFY (insert, update, delete), CREATE TABLE, CREATE SCHEMA, READ VOLUME, WRITE VOLUME, EXECUTE (functions), BROWSE (see metadata without data access), MANAGE and ALL PRIVILEGES. Each object has an owner who can grant on it. For example, to let the analysts group query every table in main.sales: GRANT USE CATALOG ON CATALOG main TO analysts; GRANT USE SCHEMA, SELECT ON SCHEMA main.sales TO analysts.
Why we use it
Data must be shared with the right people only. SQL-based grants give one consistent, auditable permission model across notebooks, SQL warehouses, jobs and BI tools, instead of per-tool security.
When to use it
Grant to groups, at the highest level that is still correct (often the schema). Use table-level grants for exceptions and row filters or column masks when users may see only part of a table. Review with SHOW GRANTS.
How it works
- User runs SELECT on main.sales.orders
- Has USE CATALOG on main? Yes: Check the schema. No: Permission denied.
- Has USE SCHEMA on main.sales? Yes: Check the table. No: Permission denied.
- Has SELECT on the table, schema or catalog? Yes: Rows are returned. No: Permission denied.
- Every check is written to the audit log
Syntax
GRANT <privilege>[, ...] ON <CATALOG | SCHEMA | TABLE | VOLUME | FUNCTION> name TO `principal`
REVOKE <privilege> ON <object> FROM `principal`
SHOW GRANTS [`principal`] ON <object>
ALTER TABLE t OWNER TO `group`
Privileges: USE CATALOG, USE SCHEMA, SELECT, MODIFY, CREATE TABLE, READ VOLUME, WRITE VOLUME, EXECUTE, BROWSE, MANAGE, ALL PRIVILEGESExample
-- Analysts can read everything in main.sales
GRANT USE CATALOG ON CATALOG main TO `analysts`;
GRANT USE SCHEMA, SELECT ON SCHEMA main.sales TO `analysts`;
-- Engineers can also write and create tables
GRANT USE SCHEMA, SELECT, MODIFY, CREATE TABLE ON SCHEMA main.sales TO `data-engineers`;
GRANT READ VOLUME, WRITE VOLUME ON VOLUME main.sales.raw_files TO `data-engineers`;
-- Check and undo
SHOW GRANTS ON SCHEMA main.sales;
REVOKE MODIFY ON SCHEMA main.sales FROM `data-engineers`;Key points
- Reading a table needs USE CATALOG + USE SCHEMA + SELECT
- Grants on a catalog or schema are inherited by current and future objects
- Grant to groups, not individual users
- Owners can grant on their objects; MANAGE lets non-owners manage permissions
- BROWSE lets people discover objects without reading data