Databricks DE · Topic 8.2
GRANT/REVOKE privileges on securable objects to account groups — with the USE CATALOG → USE SCHEMA → SELECT chain and downward inheritance. This deep dive walks the model and the SQL.
USE CATALOG + USE SCHEMA + SELECT. Privileges inherit downward (catalog → schema → table). Grant to groups, not users.USE CATALOG badges into the building, USE SCHEMA onto the floor, SELECT into the room. You need all three — and you issue keycards to teams, not individuals.▸ goal: read prod.sales.orders
GRANT <privilege> ON <securable> <name> TO <principal>. All three rungs are required to read a table. Grant to groups (synced via SCIM / identity federation).
GRANT USE CATALOG ON CATALOG prod TO `analysts`; -- badge: building GRANT USE SCHEMA ON SCHEMA prod.sales TO `analysts`; -- badge: floor GRANT SELECT ON TABLE prod.sales.orders TO `analysts`; -- key: the room
| Category | Privileges |
|---|---|
| Read/write data | SELECT, MODIFY |
| Traverse | USE CATALOG, USE SCHEMA, USE CONNECTION |
| Create | CREATE TABLE, CREATE SCHEMA, CREATE VOLUME, CREATE FUNCTION, CREATE MATERIALIZED VIEW |
| Functions / files | EXECUTE, READ VOLUME, WRITE VOLUME |
| Discovery / governance | BROWSE, APPLY TAG |
| Admin | MANAGE, ALL PRIVILEGES |
GRANT EXECUTE ON FUNCTION prod.sales.mask_email TO `analysts`; -- UC function GRANT READ VOLUME ON VOLUME prod.sales.landing TO `loaders`; -- files GRANT MODIFY ON TABLE prod.sales.orders TO `data_eng`; -- write
▸ a grant at a level can cover children (grant once, not table-by-table)
-- everyone in analysts reads ALL current & future tables in the schema GRANT SELECT ON SCHEMA prod.sales TO `analysts`; -- (+ USE CATALOG/USE SCHEMA)
ALTER TABLE prod.sales.orders OWNER TO `data_eng`; -- transfer ownership (to a group) GRANT MANAGE ON SCHEMA prod.sales TO `sales_admins`; -- delegate grant authority SHOW GRANTS ON TABLE prod.sales.orders; -- audit who can do what REVOKE SELECT ON TABLE prod.sales.orders FROM `analysts`;
Who can grant: the object owner, holders of MANAGE, or metastore/account admins. Some actions (DROP/ALTER) require ownership.
| Grant level | Covers | Use when |
|---|---|---|
| Table/view | one object | fine-grained, exceptional access |
| Schema | all current + future objects | a team owns a subject area |
| Catalog | everything in the catalog | broad env/domain access |
USE CATALOG prod, USE SCHEMA prod.sales, SELECT ON SCHEMA prod.sales — granted to the analysts group, so onboarding/offboarding is just group membership.EXECUTE/READ VOLUME for functions/files.SELECT but forgetting USE CATALOG/USE SCHEMA → still denied.EXECUTE/READ VOLUME — tables aren't the only securables.