Sub topic 13
Permissions and Governance Across Layers
This chapter assumes you know basic SQL, can read a Unity Catalog three-level name (catalog.schema.table), and have seen the bronze, silver, and gold layout from earlier chapters. Here you will give each layer the access it needs and no more.
Why permissions follow layers
Each layer has a different audience. Bronze holds raw data that may contain malformed rows or sensitive fields. Silver holds cleaned records that engineers and data scientists often need. Gold holds business-ready tables that analysts and dashboards read.
If every user can read every layer, someone will eventually build a report on bronze data that has not been deduplicated. Restricting access by layer steers consumers toward the tables you have validated.
How Unity Catalog grants work
Unity Catalog uses a hierarchy: catalog, then schema, then table. A user needs privileges at each level to read a table.
USE CATALOGlets a principal see into the catalog.USE SCHEMAlets a principal see into the schema.SELECTlets a principal read tables.
Privileges granted on a schema are inherited by the tables in it, including tables created later. So one grant on main.gold covers every current and future gold table.
Granting access to analysts
Grant to groups, not to individual users. Group membership is then managed in one place, and your SQL does not change when people join or leave.
GRANT USE CATALOG ON CATALOG main TO `analysts`;
GRANT USE SCHEMA ON SCHEMA main.gold TO `analysts`;
GRANT SELECT ON SCHEMA main.gold TO `analysts`;The analysts can now query main.gold tables. They cannot list the tables in main.bronze or main.silver, because they have no USE SCHEMA on those schemas.
Granting access to engineers
The engineering group needs to write to every layer. Give it the privileges that pipelines need.
GRANT USE CATALOG ON CATALOG main TO `data_engineers`;
GRANT USE SCHEMA, SELECT, MODIFY ON SCHEMA main.bronze TO `data_engineers`;
GRANT USE SCHEMA, SELECT, MODIFY ON SCHEMA main.silver TO `data_engineers`;
GRANT USE SCHEMA, SELECT, MODIFY ON SCHEMA main.gold TO `data_engineers`;MODIFY allows inserts, updates, deletes, and merges. Creating tables needs a separate CREATE TABLE privilege on the schema. Scheduled jobs usually run as a service principal, which is an identity for automation. Grant that principal the write privileges, so that pipelines do not depend on one person's account.
You can check what a group holds with SHOW GRANTS:
SHOW GRANTS ON SCHEMA main.gold;Governance beyond grants
Grants answer who can read a table. Unity Catalog also helps answer where data came from and who used it.
- Lineage records which tables feed which. If a gold table looks wrong, lineage shows the silver and bronze tables behind it.
- Audit logs record access and changes, which helps with compliance questions.
- Row filters and column masks limit what a user sees inside a table. Use them when a gold table contains a sensitive column, such as an email address, that only some analysts may see.
Bronze often keeps raw personal data because it must stay replayable. Restrict bronze tightly, and decide in silver whether to drop, hash, or mask sensitive fields before they reach gold.
Common errors
- Granting
SELECTwithoutUSE SCHEMA. The user still gets a permission error. All three levels are required. - Granting on the whole catalog.
SELECTonmainexposes bronze and silver through inheritance. Grant on the gold schema instead. - Granting to individuals. Access drifts and becomes hard to audit. Use groups.
- Forgetting new objects. If you grant per table, new gold tables are invisible to analysts. Grant on the schema.
Exercise
A new group finance should read only the table main.gold.daily_revenue, nothing else. Which privileges does it need, and at which levels?
Show answer
USE CATALOG on main, USE SCHEMA on main.gold, and SELECT on the table main.gold.daily_revenue. Granting SELECT on the table, not the schema, keeps other gold tables hidden. Bronze and silver stay inaccessible because no privileges are granted there.