Key points
Role-Based Access Control (RBAC) is the mechanism Snowflake uses to decide whether a session can perform an action against an object.
The model has one rigid property that drives every other behavior on this chapter: privileges do not attach to users. They attach to roles.
A user receives capability only by being granted a role, and the user then activates that role inside a session before the privileges take effect.
Any wrong answer that describes a GRANT SELECT ON tbl TO USER alice shape is wrong at the syntax level, because Snowflake's grammar forbids granting object privileges directly to a user.
The redirection of every grant through a role is what lets a Snowflake admin reorganize team responsibilities by moving role memberships without touching object-level grants, and it is also what lets the same human have very different capabilities depending on which role is active. A role is itself a securable object:
- it can hold privileges on other objects,
- it can be granted to users,
- it can be granted to other roles.
When role A is granted to role B, role B is said to inherit role A's privileges; activating role B during a session effectively gives access to everything role A holds plus everything role B holds directly.
This chained inheritance is what produces the Snowflake role hierarchy, a directed graph whose root is the built-in role ACCOUNTADMIN.
The hierarchy is not magic: it is just a set of role-to-role grants that Snowflake creates and maintains for the built-in administrative roles.
The same GRANT ROLE … TO ROLE … syntax is used to extend the hierarchy with custom roles.
Built-in Account Roles
Snowflake creates a fixed set of account-level roles when an account is provisioned. Account roles are scoped to the entire account, which means they can be granted privileges on any object across any database, and they are the only roles that can be granted directly to users from any database context. The built-in account roles, ordered top-down by privilege inheritance, are:
- ACCOUNTADMIN: the apex of the role graph. It inherits SYSADMIN and SECURITYADMIN, so it transitively holds every privilege those roles hold, plus account-level privileges that no other role can hold (managing reader accounts, viewing billing, accepting Marketplace terms, configuring account-wide network policies). It should be granted only to a small number of human operators and used only for tasks that no other role can perform.
- SECURITYADMIN: holds the
MANAGE GRANTSprivilege at account level, which lets it grant or revoke any privilege on any object across the account. It is also the parent of USERADMIN by default. Use this role for operations that cross multiple object owners, such as setting up a new analytics team's access to data created under a different functional area. - USERADMIN: owns the user and role lifecycle. It is the role that runs
CREATE USER,CREATE ROLE,ALTER USER, andGRANT ROLE … TO USER …. By default it has no privileges on data objects, which is the right separation of duties: the person provisioning identity does not also need to read finance data to do their job. - SYSADMIN: by default the recommended owner of all data objects (databases, schemas, tables, views, warehouses) created under it or under custom roles that inherit from it. The official guidance is to organize custom roles so that their privileges roll up to SYSADMIN, which makes SYSADMIN a single point of audit for data-object ownership without forcing every operator to escalate to ACCOUNTADMIN.
- PUBLIC: a special pseudo-role automatically granted to every user. Privileges granted to PUBLIC become globally available, which is sometimes useful (sharing a help-text view) and sometimes catastrophic (accidentally exposing a sensitive table). PUBLIC sits at the bottom of the hierarchy with no inheritance.
-- Inspect the built-in roles created at account provisioning
USE ROLE ACCOUNTADMIN;
SHOW ROLES;
-- Inspect which roles a user holds
SHOW GRANTS TO USER alice;
-- Inspect which roles inherit from a parent role
SHOW GRANTS OF ROLE SYSADMIN;
Custom Roles
Custom roles are user-defined roles you create with CREATE ROLE. The exam expects two facts about custom roles.
First, a freshly created custom role has no privileges and no parent; it sits in the role graph by itself until you grant it to another role. Second, the documented convention is to grant every custom role to SYSADMIN (or to a custom role that itself rolls up to SYSADMIN), so that SYSADMIN remains the operational super-role for the data-object graph.
Skipping this step is a classic configuration error: a custom role that owns a database is invisible to SYSADMIN, which means a separation-of-duties review or a routine ownership audit will miss the object.
USE ROLE USERADMIN;
CREATE ROLE finance_reader;
CREATE ROLE finance_writer;
-- Wire the custom roles into the hierarchy
USE ROLE SECURITYADMIN;
GRANT ROLE finance_reader TO ROLE finance_writer; -- writer inherits reader
GRANT ROLE finance_writer TO ROLE SYSADMIN; -- writer rolls up to SYSADMIN
-- Assign users
GRANT ROLE finance_reader TO USER alice;
GRANT ROLE finance_writer TO USER bob;
Database Roles
Database roles are scoped to a single database.
They look like account roles in syntax but have one important constraint: a database role cannot be granted directly to a user.
It must be granted to an account role, which in turn is granted to the user.
Database roles are the right pattern when a data product team distributes a sharable database (or a Listing on the Marketplace) and wants to package read-only and read-write personas with the database itself, instead of relying on the consuming account to invent new roles.
Because they ride along with the database, database roles also survive replication and cloning of the database.
USE ROLE SYSADMIN;
CREATE DATABASE sales;
USE DATABASE sales;
-- Create database-scoped roles
CREATE DATABASE ROLE sales.analyst;
CREATE DATABASE ROLE sales.editor;
-- Privileges granted to a database role behave normally
GRANT USAGE ON SCHEMA sales.public TO DATABASE ROLE sales.analyst;
GRANT SELECT ON ALL TABLES IN SCHEMA sales.public TO DATABASE ROLE sales.analyst;
-- Database role must be granted to an account role to reach a user
GRANT DATABASE ROLE sales.analyst TO ROLE finance_reader;
Diagram: Built-in Role Hierarchy
The arrows in the diagram point from parent to child, where the parent inherits the child's privileges. Reading the chart top-down: ACCOUNTADMIN inherits SECURITYADMIN and SYSADMIN, SECURITYADMIN inherits USERADMIN, and SYSADMIN inherits any custom roles you have wired beneath it.
💡 Exam Trap: Snowflake never lets you grant an object privilege directly to a user. Any answer that shows
GRANT SELECT ON TABLE … TO USER aliceis wrong on syntax. Privileges flow to users only via role membership.
💡 Exam Trap: Database roles cannot be granted directly to a user. The required pattern is
GRANT DATABASE ROLE <db>.<dbrole> TO ROLE <account_role>, thenGRANT ROLE <account_role> TO USER <user>. Skipping the intermediate account role is a common distractor.
⚠️ Anti-Pattern: Treating ACCOUNTADMIN as the daily operating role. ACCOUNTADMIN has visibility into billing, organization-level objects, and consent flows; everyday object creation should happen under SYSADMIN or a custom role rolled up to SYSADMIN. Running routine ingestion under ACCOUNTADMIN means a careless mistake (dropping the wrong database, exporting credentials) has account-wide blast radius.
📊 Limit: A Snowflake account has exactly one PUBLIC role per account, and it is automatically granted to every user. You cannot remove this default grant; you can only avoid granting sensitive privileges to PUBLIC.
🎯 Scenario: A new analytics team needs read access to a shared product-events database. The team lead asks ACCOUNTADMIN to run
GRANT SELECT ON ALL TABLES IN SCHEMA … TO USER team_lead. The right design is different: USERADMIN creates a custom roleproduct_events_reader, SECURITYADMIN grants USAGE on the database and SELECT on the schema's tables to that role, then USERADMIN grants the role to the team lead and to every team member. The user identity work and the privilege work are separated, and the next time someone joins the team only a singleGRANT ROLEis needed.
Decision Anchor: Choose a custom role when the team has stable, project-specific access needs and you want to insulate the data-object graph from individual user churn. Choose a database role when the access bundle should travel with a sharable database (Listings, replication, cloning) and the consumer account should not have to redesign its own role hierarchy to use the data.
The role hierarchy is also what produces the famous "user is granted ACCOUNTADMIN but cannot see the new database" support question. The cause is almost always that the role was granted to the user but not activated in the session: the user has the role available, but the active role at the time of the query is something else, and the query is evaluated against the active role's privileges.
The chapter section on session context revisits this directly. ---
