Sub topic 4
Privilege types and what they allow
This chapter covers the privileges Unity Catalog defines, which object each one applies to, and what each one lets a principal do. It assumes you know basic SQL, can run statements in a Databricks notebook or the SQL editor, and have read the chapters on the object hierarchy and on principals and groups.
What a privilege is
A privilege is a permission on one securable object. Each privilege has a name, such as SELECT, and it applies only to certain object types. SELECT makes sense on a table but not on a catalog. CREATE SCHEMA makes sense on a catalog but not on a table.
Three rules hold for every privilege:
- Privileges are additive. Unity Catalog has no explicit deny. A principal's effective access is the union of everything granted to it directly, to its groups, and on parent objects.
- Privileges are specific to an object type. Granting one on the wrong type returns an error.
- Most privileges are checked together with others. Reading a table takes three privileges at three levels of the hierarchy.
Groups of privileges
It helps to sort privileges by purpose.
| Purpose | Privileges | Applies to |
|---|---|---|
| Traverse the hierarchy | `USE CATALOG`, `USE SCHEMA` | Catalogs, schemas |
| Read and write data | `SELECT`, `MODIFY` | Tables, views, materialized views |
| Read and write files | `READ VOLUME`, `WRITE VOLUME` | Volumes |
| Run code | `EXECUTE` | Functions, registered models |
| Create child objects | `CREATE CATALOG`, `CREATE SCHEMA`, `CREATE TABLE`, `CREATE VOLUME`, `CREATE FUNCTION` | Metastore, catalogs, schemas |
| Reach cloud storage | `READ FILES`, `WRITE FILES`, `CREATE EXTERNAL TABLE`, `CREATE EXTERNAL VOLUME` | Storage credentials, external locations |
| Discover and label | `BROWSE`, `APPLY TAG` | Catalogs and most objects |
| Administer | `MANAGE`, `ALL PRIVILEGES` | Most securable objects |
Other privileges exist for sharing and connections, such as CREATE SHARE and USE CONNECTION. They follow the same rules. Check the Databricks privilege reference for the exact list in your release.
Traversal privileges: USE CATALOG and USE SCHEMA
USE CATALOG and USE SCHEMA do not give access to data. They let a principal resolve a name inside the catalog or schema. Without them, a SELECT on a table fails even if the principal holds SELECT on that table.
This produces the most common permission error in Unity Catalog. A user is granted SELECT on a table and still cannot query it, because nobody granted USE CATALOG and USE SCHEMA on the parents.
GRANT USE CATALOG ON CATALOG main TO `data-analysts`;
GRANT USE SCHEMA ON SCHEMA main.sales TO `data-analysts`;
GRANT SELECT ON TABLE main.sales.orders TO `data-analysts`;The same rule applies to every object type. To read a file in a volume, the principal needs USE CATALOG, USE SCHEMA, and READ VOLUME. To call a function, it needs USE CATALOG, USE SCHEMA, and EXECUTE.
Data privileges: SELECT and MODIFY
SELECT lets a principal read rows from a table or view. It also lets them read the schema of the object.
MODIFY lets a principal change data with INSERT, UPDATE, DELETE, and MERGE. It does not imply SELECT. A statement such as UPDATE ... WHERE status = 'open' or a MERGE has to read rows, so a principal that writes with predicates normally needs both privileges.
GRANT SELECT, MODIFY ON TABLE main.sales.orders TO `data-engineers`;Neither privilege lets a principal change the table definition. Altering columns or dropping the table requires ownership or MANAGE, covered in the ownership chapter.
Views
A view is its own securable object. A principal needs SELECT on the view, plus USE CATALOG and USE SCHEMA on the view's parents. They do not need any privilege on the underlying tables. The view's owner must hold SELECT on those tables, and the owner's rights are used when the view runs. This is why views can expose a filtered slice of a table to people who cannot read the table. The dynamic views chapter builds on it.
File privileges: READ VOLUME and WRITE VOLUME
A volume holds files rather than rows. READ VOLUME allows reading files and listing them. WRITE VOLUME allows adding, changing, and deleting files.
GRANT READ VOLUME ON VOLUME main.sales.raw_files TO `data-analysts`;
GRANT WRITE VOLUME ON VOLUME main.sales.raw_files TO `data-engineers`;Execution privileges: EXECUTE
EXECUTE lets a principal call a user-defined function or load a registered model. It matters for row filter and column mask functions. A principal does not need EXECUTE for a filter or mask function attached to a table they query, because the function runs as part of the table's policy. They would need it to call the function directly.
GRANT EXECUTE ON FUNCTION main.sales.us_only TO `data-analysts`;Creation privileges
Creation privileges are granted on the parent. To create a child, a principal needs the matching CREATE privilege on the parent, plus USE privileges to reach it.
| To create a... | Grant this | On this object |
|---|---|---|
| Catalog | `CREATE CATALOG` | Metastore |
| Schema | `CREATE SCHEMA` | Catalog |
| Table | `CREATE TABLE` | Schema |
| Volume | `CREATE VOLUME` | Schema |
| Function | `CREATE FUNCTION` | Schema |
GRANT USE CATALOG ON CATALOG main TO `data-engineers`;
GRANT USE SCHEMA, CREATE TABLE ON SCHEMA main.sales TO `data-engineers`;The creator of an object becomes its owner. Ownership carries rights that no ordinary privilege carries, so CREATE privileges are more powerful than they look. A group with CREATE SCHEMA on a catalog will own every schema its members create.
Storage privileges
Cloud storage is not governed through the table privileges above. Paths are secured through external locations and storage credentials. READ FILES and WRITE FILES allow direct path access under an external location. CREATE EXTERNAL TABLE and CREATE EXTERNAL VOLUME allow registering objects whose data lives there.
GRANT CREATE EXTERNAL TABLE ON EXTERNAL LOCATION landing_zone TO `data-engineers`;Hold back READ FILES and WRITE FILES unless a team needs raw path access. They bypass table-level controls such as row filters and column masks, because they read the files directly.
Discovery and labeling: BROWSE and APPLY TAG
BROWSE lets a principal see an object's metadata in Catalog Explorer and in search results, without reading any data. This helps teams find datasets and then request access.
GRANT BROWSE ON CATALOG main TO `all-employees`;APPLY TAG lets a principal attach or remove tags on an object. It does not allow reading or writing data.
Administrative privileges: MANAGE and ALL PRIVILEGES
MANAGE lets a principal grant and revoke privileges on an object, transfer its ownership, rename it, and drop it. It gives the management rights of an owner without making the principal the owner. It does not by itself allow reading the data. A principal with MANAGE can grant themselves SELECT, so treat it as equivalent to broad access.
ALL PRIVILEGES is a shorthand that grants every privilege that applies to the object. Granted on a schema, it covers the schema-level privileges and, through inheritance, the privileges that apply to the objects inside it. Use it sparingly. It hides what a principal can actually do, and it grows when Databricks adds new privilege types.
GRANT ALL PRIVILEGES ON SCHEMA main.sales TO `sales-owners`;Checking what is granted
SHOW GRANTS lists privileges on an object, or the privileges one principal holds on it.
SHOW GRANTS ON TABLE main.sales.orders;
SHOW GRANTS `data-analysts` ON SCHEMA main.sales;The output includes the principal, the object type, the privilege, and the object on which it was granted. Check the object column. A privilege inherited from a schema or catalog appears against that parent, not against the table.
Common errors
- SELECT works for some tables but not others. Check whether the grant is on the table or the schema. A table-level grant covers only that table.
- Permission error despite SELECT. The principal probably lacks
USE CATALOGorUSE SCHEMAon a parent. - User can create tables but not read them back.
CREATE TABLEdoes not grantSELECTon other people's tables. The creator owns the new table, but others in the group do not. - Granting to a user instead of a group. The grant works but is hard to review and revoke. Prefer groups.
- Expecting a deny. Revoking a privilege from a group does not block a user who has the same privilege through another group or a parent object.
Exercise
A group data-analysts holds SELECT on main.sales.orders but gets a permission error when querying it. They hold USE CATALOG on main. What is missing, and which statement fixes it?
Show answer
They lack USE SCHEMA on main.sales. Run GRANT USE SCHEMA ON SCHEMA main.sales TO data-analysts;. Querying a table needs USE CATALOG, USE SCHEMA, and SELECT.
Exercise
Why is MANAGE on a table close to the same as SELECT on it, even though MANAGE does not allow reading data?
Show answer
A principal with MANAGE can grant privileges on the object, so they can grant themselves SELECT. Treat MANAGE as broad access.
Exercise
A team needs to load files into a volume but must not be able to read other tables. Which privileges does it need?
Show answer
USE CATALOG on the catalog, USE SCHEMA on the schema, and WRITE VOLUME on the volume. Add READ VOLUME if the team also needs to read the files back.