Unity Catalog Permissions Model

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 10 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Lesson: The Unity Catalog Permissions Model

Introduction: Why Data Governance Matters

In modern data architecture, the ability to control who can see, modify, or delete data is no longer optional—it is a fundamental requirement for business operations. As organizations scale their data platforms, managing access manually through legacy methods, such as individual table grants or complex file-system permissions, becomes unsustainable. This is where Unity Catalog (UC) changes the landscape. Unity Catalog is a unified governance solution for data and AI on the Databricks platform, providing a centralized interface to manage permissions across your entire data estate.

Understanding the Unity Catalog permissions model is essential because it shifts the focus from managing security at the file or storage layer to managing it at the data object layer. By using a centralized model, you ensure that your security policies are consistent, auditable, and easy to manage. Whether you are a data engineer, a data scientist, or a security administrator, mastering this model allows you to implement the principle of least privilege—giving users exactly the access they need, and nothing more. This lesson will guide you through the structural components of the UC permissions model, how to apply them, and the best practices required to maintain a secure and compliant environment.


Not read yet

Understanding the Unity Catalog Hierarchy

To manage permissions effectively, you must first understand the object hierarchy within Unity Catalog. Permissions in UC follow a hierarchical structure, meaning that access granted at a higher level often cascades down to lower levels. This inheritance model is a powerful tool for simplifying administration, but it requires careful planning to avoid accidentally granting broad access.

The Object Hierarchy

The hierarchy generally follows this path:

  1. Metastore: The top-level container for all data and AI assets.
  2. Catalog: The root of the data hierarchy (e.g., prod, dev, sandbox).
  3. Schema (Database): A logical grouping of tables and views within a catalog.
  4. Table/View/Volume: The actual data assets that users interact with.
  5. Function/Model: Specialized assets like registered models or user-defined functions.

When you grant a permission on a catalog, that permission applies to all schemas, tables, and views within that catalog. If you grant a permission on a schema, it applies to all tables within that schema. This design allows for "coarse-grained" access control at the top and "fine-grained" access control as you move down the tree.

Callout: Inheritance vs. Explicit Grants Unity Catalog uses an inheritance model where permissions granted on parent objects are inherited by their children. However, it is important to note that you cannot "deny" access at a lower level to override a "grant" at a higher level. If a user is granted SELECT on a Catalog, they will have SELECT on every table within that catalog. Plan your hierarchy carefully to ensure that broad access is only granted where it is absolutely necessary.


Not read yet

The Core Permissions Model: Grant and Revoke

The Unity Catalog permissions model is built on standard SQL commands: GRANT and REVOKE. This approach makes it intuitive for database administrators and data engineers who are already familiar with standard SQL syntax.

The GRANT Command

The GRANT command is used to assign a specific privilege to a user, group, or service principal. The basic structure is: GRANT <privilege> ON <object_type> <object_name> TO <principal>;

For example, to give a data analyst group read access to a specific schema: GRANT USE SCHEMA ON SCHEMA sales_data TO analyst_group; GRANT SELECT ON SCHEMA sales_data TO analyst_group;

The REVOKE Command

The REVOKE command removes previously assigned privileges. It is essential for managing lifecycle changes, such as when an employee changes roles or a project ends. REVOKE <privilege> ON <object_type> <object_name> FROM <principal>;

Tip: Use Groups, Not Individuals Always assign permissions to groups rather than individual users. When a user joins or leaves a team, you simply move them in or out of the relevant group in your identity provider (like Azure AD or Okta). This ensures that your permissions remain consistent and reduces the administrative burden of updating individual grants.


Not read yet

Essential Privileges in Unity Catalog

To build a functional environment, you need to understand the different types of privileges available. These are categorized into data access, object management, and administrative privileges.

Data Access Privileges

  • SELECT: Allows users to read data from tables or views.
  • MODIFY: Allows users to insert, update, or delete data in tables.
  • READ_METADATA: Allows users to see that an object exists and view its metadata (like column names) without necessarily being able to read the data within.

Object Management Privileges

  • USE CATALOG / USE SCHEMA: These are foundational privileges. A user must have USE access to a parent container to navigate to the child objects within it.
  • CREATE TABLE / CREATE VIEW: Allows users to define new data assets within a schema.
  • CREATE FUNCTION: Allows users to define custom logic.

Administrative Privileges

  • METASTORE ADMIN: Full control over the entire metastore. This should be restricted to a very small number of individuals.
  • BROWSE: A special privilege that allows users to see an object in the Catalog Explorer UI, even if they don't have explicit data access.

Not read yet

Practical Implementation: A Step-by-Step Scenario

Let's walk through a common scenario: setting up a secure environment for a "Finance" team.

Step 1: Create the Hierarchy

First, we establish the container for the finance data.

-- Create the catalog
CREATE CATALOG finance_prod;

-- Create the schema
CREATE SCHEMA finance_prod.reporting;

Step 2: Define Groups

In your identity provider, create a group called finance_analysts. In Databricks, this group will be synchronized.

Step 3: Grant Access

We want the analysts to be able to see the schema and read the tables, but not modify them.

-- Allow them to enter the catalog
GRANT USE CATALOG ON CATALOG finance_prod TO finance_analysts;

-- Allow them to enter the schema
GRANT USE SCHEMA ON SCHEMA finance_prod.reporting TO finance_analysts;

-- Allow them to read data
GRANT SELECT ON SCHEMA finance_prod.reporting TO finance_analysts;

Step 4: Verification

You can verify the current permissions using the SHOW GRANTS command.

SHOW GRANTS ON SCHEMA finance_prod.reporting;

This command will return a table showing exactly which principals have which privileges on that schema. Regularly auditing these results is a best practice to ensure no "permission creep" has occurred.


Not read yet

Advanced Access Control: Dynamic Views and Row-Level Security

Sometimes, simple SELECT grants are not enough. You may have a requirement where a user can see rows belonging to their department, but not rows from other departments. Unity Catalog handles this through Dynamic Views.

By using SQL functions like current_user() or is_account_group_member(), you can create views that filter data on the fly.

Example: Row-Level Filtering

Suppose you have a table sales_data with a column department. You want to ensure that users only see rows for their own department.

CREATE VIEW finance_prod.reporting.filtered_sales AS
SELECT * FROM finance_prod.reporting.sales_data
WHERE department = (
    CASE 
        WHEN is_account_group_member('finance_team') THEN 'Finance'
        WHEN is_account_group_member('sales_team') THEN 'Sales'
        ELSE 'Unknown'
    END
);

When a user in the finance_team queries this view, the WHERE clause automatically filters the data to only show 'Finance' records. This is a powerful way to implement data masking and row-level security without creating hundreds of separate tables.

Warning: Performance Implications While dynamic views are excellent for security, they can introduce performance overhead if the logic is overly complex. Always test your views with representative data volumes to ensure that the CASE statements or subqueries do not significantly slow down query execution.


Not read yet

Comparison Table: Legacy Access vs. Unity Catalog

Feature Legacy (Hive Metastore) Unity Catalog
Scope Table/Database level Catalog/Schema/Table/Volume/Model
Identity Spark-level session users Centralized Identity (SCIM)
Auditability Limited Centralized Audit Logs
Cross-Workspace Difficult Native
Governance Decentralized Centralized

As shown in the table, Unity Catalog provides a much more robust framework for modern data teams. By centralizing the management of identity and access, it removes the friction of managing security across multiple workspaces.


Best Practices for Managing Permissions

1. The Principle of Least Privilege

Always start by granting no access. Only add the specific privileges required for a user to perform their job. If a user only needs to read a table, do not grant them MODIFY or CREATE privileges.

2. Leverage Managed Identities and Service Principals

For automated jobs and pipelines, avoid using personal access tokens or individual user credentials. Use Service Principals. Assign the service principal to a group, and grant that group the necessary permissions. This ensures that when a developer leaves the company, your pipelines do not break.

3. Use Catalog-Level Architecture

Organize your catalogs by environment (e.g., dev, test, prod) or by business unit (e.g., finance, marketing). This logical separation makes it much easier to apply broad security policies that cover all related assets.

4. Regular Auditing

Unity Catalog records all permission changes in the audit logs. Use these logs to monitor for unauthorized access attempts or unexpected changes to permissions. Set up alerts for GRANT or REVOKE commands executed by users who are not authorized to perform administrative tasks.

5. Avoid "Public" Grants

It is tempting to grant SELECT access to the users group (which usually includes everyone in the workspace) to save time. Do not do this. This creates a massive security hole where sensitive data is exposed to everyone by default. Always be explicit in your grants.


Not read yet

Common Pitfalls and How to Avoid Them

Pitfall 1: Over-Granting at the Catalog Level

A common mistake is granting SELECT on a whole catalog when a user only needs one specific table. While this is faster to configure, it violates the principle of least privilege.

  • The Fix: Grant USE CATALOG and USE SCHEMA to the user, and then grant SELECT only on the specific table they need.

Pitfall 2: Confusing USE Privileges with Data Access

New users often forget that USE CATALOG and USE SCHEMA are required to even see the data objects. If a user complains they cannot see a table, check if they have the necessary USE privileges on the parent catalog and schema first.

  • The Fix: Always grant the full chain of USE permissions when onboarding a new user to a data asset.

Pitfall 3: Failing to Manage Ownership

Every object in Unity Catalog has an owner. The owner has full control, including the ability to grant permissions to others. If a user creates a table, they become the owner. If that user leaves, you may lose control over that table.

  • The Fix: Assign ownership of critical schemas and tables to a Group rather than an individual. This ensures that multiple administrators can manage the object if one person leaves.

Not read yet

Frequently Asked Questions (FAQ)

Q: Can I use Unity Catalog with external data? A: Yes. Unity Catalog supports "External Locations." You can define an external location in your cloud storage (S3, ADLS, GCS) and grant users access to it, allowing them to create tables on top of that storage without giving them direct access to the underlying cloud bucket.

Q: How do I transfer ownership of a table? A: You can use the ALTER TABLE command: ALTER TABLE <table_name> SET OWNER TO `.

Q: If I revoke a privilege, how long does it take to take effect? A: Changes to permissions in Unity Catalog are generally effective immediately. However, active sessions may need to be refreshed or restarted depending on the specific configuration.

Q: Is there a way to see all permissions for a specific user? A: Yes, you can use the SHOW GRANTS FOR <user_or_group> command to see every object that a specific principal has access to.


Not read yet

Comprehensive Key Takeaways

  1. Centralization is Key: Unity Catalog moves security from the storage layer to the data object layer, providing a unified view of your entire organization’s data access.
  2. Hierarchy Matters: Understand the parent-child relationship of Metastore -> Catalog -> Schema -> Table. Permissions flow downward, so be intentional about where you place your GRANT commands.
  3. Group-Based Governance: Always assign permissions to groups synchronized from your identity provider. This prevents the management nightmare of tracking individual user permissions.
  4. Least Privilege: Start with zero access and grant only what is necessary. Use SELECT, MODIFY, and CREATE privileges judiciously to maintain a secure environment.
  5. Dynamic Security: Use Dynamic Views with current_user() logic to implement sophisticated, row-level security without duplicating data.
  6. Ownership Management: Assign ownership of important data assets to groups rather than individuals to ensure continuity of administration.
  7. Audit and Monitor: Use the built-in audit logs to track changes to your permissions model. Proactive monitoring is the best way to prevent unauthorized access and maintain compliance.

By following these principles and utilizing the tools provided within the Unity Catalog permissions model, you can build a robust, scalable, and secure data environment. Remember that security is an ongoing process, not a one-time configuration; as your data landscape evolves, your permission structure should be reviewed and refined accordingly.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.