Unity Catalog Grants
SchemaX lets you manage Unity Catalog grants (privileges) on catalogs, schemas, tables, views, volumes, functions, and materialized views from the designer and via the CLI. Grants are stored in your schema state and emitted as GRANT / REVOKE statements when you generate SQL or run schemax apply.
Where you can manage grants
| Securable | Where in SchemaX |
|---|---|
| Catalog | Select a catalog in the tree → detail panel → Grants section |
| Schema | Select a schema in the tree → detail panel → Grants section |
| Table | Select a table → Security & Governance (or table detail) → Grants section |
| View | Select a view → detail panel → Grants section |
| Volume | Select a volume → detail panel → Grants section |
| Function | Select a function → detail panel → Grants section |
| Materialized View | Select a materialized view → detail panel → Grants section |
Add or remove grants per principal (user, group, or service principal). Each grant has a principal and a list of privileges.
Supported privileges by object type
Catalog-level privileges
- ALL PRIVILEGES
- USE CATALOG
- USE SCHEMA
- CREATE SCHEMA
- CREATE TABLE
- CREATE VIEW
- CREATE FUNCTION
- CREATE VOLUME
- CREATE EXTERNAL LOCATION
- CREATE STORAGE CREDENTIAL
- CREATE CONNECTION
- CREATE SHARING
- CREATE RECIPIENT
- CREATE PROVIDER
- CREATE CATALOG
- CREATE MODEL
- CREATE MATERIALIZED VIEW
- CREATE PIPELINE
- EXECUTE
- MODIFY
- SELECT
- READ VOLUME
- WRITE VOLUME
- APPLY TAG
- USE MARKETPLACE ASSETS
Schema-level privileges
- ALL PRIVILEGES
- USE SCHEMA
- CREATE TABLE
- CREATE VIEW
- CREATE FUNCTION
- CREATE VOLUME
- CREATE MODEL
- CREATE MATERIALIZED VIEW
- CREATE PIPELINE
- EXECUTE
- MODIFY
- SELECT
- READ VOLUME
- WRITE VOLUME
- APPLY TAG
Table- and view-level privileges
- ALL PRIVILEGES
- SELECT
- MODIFY
- READ VOLUME
- WRITE VOLUME
- APPLY TAG
These align with Databricks SQL privileges for Unity Catalog.
Principals
Grants are assigned to principals:
- Users — e.g.
user@example.com - Groups — e.g.
data_engineers,analysts - Service principals — e.g.
12345678-1234-1234-1234-123456789012
Use the same principal names and formats that Unity Catalog expects (see Databricks documentation).
In the VS Code designer
- Select a catalog, schema, table, view, volume, function, or materialized view in the tree.
- Open the Grants section in the detail panel (catalog/schema/volume/function/materialized view) or in Security & Governance (table/view).
- Add grant: Click Add grant, enter the principal (e.g. group name or email), and choose one or more privileges.
- Revoke: Remove a grant or uncheck privileges; SchemaX will emit the appropriate
REVOKEwhen you generate SQL or apply. - Generate SQL or Apply — grants are included in the generated DDL and in
schemax applywhen the Governance managed category is enabled for that environment.
Bulk grants and tags
You can add the same grant or tag to many objects at once from the designer.
- Select a catalog or schema in the tree (this defines the scope).
- In the detail panel, click Bulk operations.
- The panel shows the scope: for a catalog, that catalog and all its schemas and tables (and views, volumes, etc.); for a schema, that schema and all its tables (and views, etc.).
- Choose the operation:
- Add catalog grant — Grant on the catalog in scope (principal + privileges).
- Add schema grants — Grant on each schema in scope.
- Add table grants — Grant on each table in scope.
- Add view grants — Grant on each view in scope.
- Add volume grants — Grant on each volume in scope.
- Add function grants — Grant on each function in scope.
- Add materialized view grants — Grant on each materialized view in scope.
- Add catalog tag — (Catalog scope only.) Set a tag name and value on the catalog.
- Add schema tag — Set a tag name and value on each schema in scope.
- Add table tag — Set a tag name and value on each table in scope.
- Add view tag — Set a tag name and value on each view in scope.
- Review the preview (number of objects affected), then click Apply.
The operations are appended to the changelog exactly as if you had added each grant or tag individually. Generate SQL or run schemax apply as usual to deploy them.
CLI and SQL generation
- Generate SQL:
schemax sql --target ENV(or VS Code Generate SQL Migration with an environment selected) includesGRANTandREVOKEstatements for grant operations in the changelog or diff. - Apply:
schemax apply --target ENVruns those statements against the target. Grant operations are part of governance; they are included when the environment’s deployment scope includes Governance (default: all categories). - Rollback: Grant changes are treated as safe; partial and complete rollback can revert grant operations where applicable.
Example generated SQL
-- Grant on catalog
GRANT USE CATALOG, CREATE SCHEMA ON CATALOG `my_catalog` TO `data_engineers`;
-- Grant on schema
GRANT USE SCHEMA, CREATE TABLE ON SCHEMA `my_catalog`.`my_schema` TO `analysts`;
-- Grant on table
GRANT SELECT, MODIFY ON TABLE `my_catalog`.`my_schema`.`my_table` TO `bi_users`;
Best practices
- Version grants with schema: Keep grants in SchemaX state and create snapshots so grant changes are reviewed and deployed with the rest of the schema.
- Use groups: Prefer group principals (e.g.
data_engineers,analysts) over individual users so membership is managed in your identity provider. - Governance-only deployments: If you only want to push grant (and other governance) changes without structural DDL, use Environments and deployment scope and set Governance as the only managed category for that environment.
- Existing catalogs: When catalogs already exist and you use existing objects, SchemaX still emits grants for those catalogs (and their schemas/tables/views) as long as Governance is in scope.
For rollback and deployment workflows, see Workflows.