Using inherited grants¶
This topic describes how to issue, migrate, audit, and troubleshoot inherited grants.
Get started¶
For most customers, the right approach is to combine inherited and granular grants to create the ideal pattern. You can start by:
- Establish a baseline with inherited grants: Grant a role the privileges it needs across all current and future objects of a type in a container.
- Layer policies and granular controls on the exceptions: Use masking policies or row access policies to handle objects that need different access than the baseline.
This pattern keeps the grant model simple and reviewable while giving you the flexibility to handle special cases without abandoning the inherited-grant baseline.
Syntax¶
Required container privileges¶
Inherited object privileges do not replace required container privileges. For a role to access an object in a schema,
the role typically also needs USAGE on the database and schema.
For example, to allow analyst_role to query tables in prod.analytics:
The inherited SELECT grant controls access to the tables. The USAGE grants allow the role to resolve the database
and schema.
Examples¶
Set up a consistent authorization profile¶
Outcome: analyst can SELECT from every existing table in sales_db, with one grant record per privilege rather
than one per table.
New objects are covered automatically¶
Continuing from the example above:
Cover multiple object types¶
Inherited grants apply to a specific object type. To extend a privilege across multiple types, issue one statement per
type (TABLES, DYNAMIC TABLES, ICEBERG TABLES, VIEWS, etc.):
Outcome: analyst can SELECT from every existing and future table, dynamic table, Iceberg table, and view in
sales_db. Object types not listed (such as materialized views or external tables) are not covered and require their
own GRANT INHERITED statement.
Account-scope grant¶
Outcome: analyst can use any current or future warehouse in the account.
Account scope includes personal databases
GRANT INHERITED <privileges> ON ALL <type> IN ACCOUNT applies to objects inside personal databases.
Grant inherited access to an application¶
Outcome: The trust_center application can read every existing and future table in sales_db without requiring
additional grants as new schemas or tables are added.
Migrate from future grants and GRANT <privileges> ON ALL¶
If you currently use future grants combined with GRANT <privileges> ON ALL to maintain a consistent authorization
profile, you can replace both with a single inherited grant. Snowflake recommends migrating in the following sequence
to avoid any gaps.
Step 1: Inventory the current state¶
Identify the existing future grants and bulk grants you intend to replace.
Look for repeated patterns such as SELECT ON ALL TABLES IN SCHEMA plus a matching SELECT ON FUTURE TABLES IN SCHEMA
for the same role and schema. These pairs are the strongest candidates for collapsing into a single inherited grant.
Step 2: Identify which patterns can collapse¶
A grant pair is safe to collapse to an inherited grant when all three of the following are true:
- The privilege is the same in the existing-objects grant and the future-objects grant.
- The grantee role is the same.
- No object in the container needs to be excluded from the privilege.
If some objects need to be excluded, do not collapse. Keep the granular grants for those objects, or apply row access policies or masking policies to handle the exceptions.
Step 3: Issue the inherited grant¶
Create the new inherited grant. The grant takes effect immediately for both existing and future objects.
Step 4: Verify parity¶
Before revoking the original grants, confirm that the role still has the expected access on a representative sample of objects.
You can use SHOW GRANTS ON TABLE <name> to confirm the inherited grant is being surfaced correctly.
Step 5: Revoke the original future and bulk grants¶
Once parity is confirmed, revoke the original grants to complete the migration.
Important
Run Step 5 only after verifying parity in Step 4. If the inherited grant is missing or incorrect, revoking the original grants will cause an access gap.
The following table summarizes when to consider migrating to inherited grants:
| Pattern | Recommended migration |
|---|---|
SELECT ON ALL TABLES + SELECT ON FUTURE TABLES to the same role | Collapse to GRANT INHERITED SELECT ON ALL TABLES IN <container>. |
USAGE ON ALL SCHEMAS + USAGE ON FUTURE SCHEMAS | Collapse to GRANT INHERITED USAGE ON ALL SCHEMAS IN DATABASE <name>. |
| Per-object grants on a small, stable set of objects | Keep as granular grants. The inherited model is not necessary. |
Future grants only (no ON ALL) used to provision new objects to a role | Collapse to GRANT INHERITED <priv> ON ALL <type> IN <container> if existing-objects coverage is also intended. |
| Grants with mixed privileges across the same object type | Keep granular. Inherited grants apply uniformly across all objects of the type. |
Representative patterns¶
The patterns below show end-to-end role hierarchies built on inherited grants. Each pattern is a target end-state; adapt the role names and container choices to your environment.
Pattern 1: Database read-access pattern¶
Use this pattern when a database serves a single team or function and you want simple read/write/admin tiers.
Outcome: Three role tiers with consistent read, write, and admin access across every current and future table and
view in sales_db. Adding a new table requires no additional grant administration.
Pattern 2: Per-domain pattern (schemas as domains)¶
Use this pattern when a single database holds multiple domains (each represented by a schema) that need independent grant administration.
Outcome: Each domain (US West, EU) has its own lead role holding MANAGE GRANTS on its schema, plus its own reader
role. Domain leads operate independently without involving the database admin or SECURITYADMIN for routine grant
management.
Pattern 3: Application access pattern¶
Use this pattern when a Snowflake-managed application (for example, a governance scanner or data-quality service) needs to read every current and future object in a container.
Outcome: The application can scan every current and future schema, table, and view in sales_db without
future-grant proliferation. New objects are covered automatically.
Audit inherited grants¶
Snowflake supports the following approaches to facilitate inherited-grant auditing.
- Use
SHOW INHERITED GRANTS IN <container>to enumerate every inherited grant defined in a database or schema. This is the most direct way to see what container-level grants are in effect. - Use the
GRANTS_TO_ROLESview inACCOUNT_USAGEwithIS_INHERITED = 'YES'to find all inherited grants account-wide, and to reconstruct the history of inherited-grant creation and revocation (including revoked grants, which appear with a non-nullDELETED_ONvalue). - For per-object access reviews, use
SHOW GRANTS ON <object>. The response includes both direct and inherited grants applicable to the object, with the source container identified in theINHERITED_FROMcolumn.
Three SHOW commands return inherited grant information, each populating four new columns.
| Command | Description |
|---|---|
SHOW GRANTS ON <object> | Regular and inherited grants on the target object, including grants inherited from upstream containers. MANAGE GRANTS from upstream are excluded from the rollup. |
SHOW GRANTS TO ROLE <role> | Regular and inherited grants directly granted to the role. Individual securables are not enumerated for performance; the NAME column is empty for inherited grant rows. |
SHOW INHERITED GRANTS IN <container> | Inherited grants defined in the specified container. |
| Column | Description |
|---|---|
IS_INHERITED | YES if the row is an inherited grant; NO otherwise. |
INHERITED_FROM | Container type the grant is inherited from: ACCOUNT, DATABASE, or SCHEMA. Empty for regular grants. |
INHERITED_FROM_DATABASE | Database name when INHERITED_FROM is DATABASE or SCHEMA. |
INHERITED_FROM_SCHEMA | Schema name when INHERITED_FROM is SCHEMA. |
The same four columns appear in the GRANTS_TO_ROLES view in ACCOUNT_USAGE and the INFORMATION_SCHEMA.
Troubleshoot inherited grants¶
| Behavior | Likely cause | Action |
|---|---|---|
SELECT query fails with “Object does not exist or not authorized” even though GRANT INHERITED SELECT ON ALL TABLES ... was issued | Missing USAGE on the parent schema or database; name resolution fails before the SELECT privilege is checked | Issue GRANT INHERITED USAGE ON ALL SCHEMAS IN DATABASE <name> and ensure the role has USAGE on the database itself. |
GRANT INHERITED ... fails with “Insufficient privileges” | Executing role lacks MANAGE GRANTS on the container or a regrantable privilege | Grant MANAGE GRANTS on the container (or higher) to the executing role, or use a role that already holds it. |
SHOW GRANTS TO ROLE <role> returns inherited rows with an empty NAME column | Expected behavior: inherited grants apply to a class of securables, not a specific object | Use SHOW INHERITED GRANTS IN <container> to see container-level grants, or SHOW GRANTS ON <object> to see the inherited grant in the context of a specific object. |
| New table created in a covered container is not accessible to the grantee | The new table is of an object type not covered by the inherited grant (for example, an ICEBERG TABLE when only TABLES was granted) | Issue an additional GRANT INHERITED statement for the new object type. |
| Inherited grant on a shared database fails | Inherited grants are not supported on imported (consumer-side) databases or shared schemas in this release | Use granular grants for shared-database flows. |