What you will be able to do
- Tell apart the DAC, RBAC and UBAC parts of Snowflake's access control model
- Describe the securable object hierarchy and how ownership and managed access schemas affect who can grant privileges
- Match each system-defined role to its responsibility
- Choose between account roles, database roles and custom roles, and explain how database roles reach a session
- Explain how primary and secondary roles combine to authorize SQL actions
Key concept
Privileges flow through roles to securable objects — In Snowflake, nothing is accessible unless a grant allows it. Privileges on objects are granted to roles (or occasionally to users), roles are granted to users or to other roles, and the roles active in a session decide what a user can do.
1.Three access control models in one framework
Snowflake does not use a single access control model. It combines three. Discretionary Access Control (DAC) means every object has an owner, and that owner decides who else gets access. Role-based Access Control (RBAC) means privileges are granted to roles, and roles are granted to users. User-based Access Control (UBAC) means privileges are granted directly to users. UBAC has a catch: privileges granted directly to a user only count when the session has secondary roles set to ALL.
Four terms run through the rest of this lesson. A securable object is anything access can be granted on. A role is an entity that privileges are granted to. A privilege is a defined level of access to an object. A user is an identity, either a person or a service. Privileges can also be granted to users, but RBAC is the usual way to manage access. Roles can be granted to other roles, which creates a role hierarchy. In that hierarchy, a role inherits the privileges of every role below it.
The documentation adds that no super-user exists who can skip these checks: every action needs the right privileges.
Checkpoint 1 of 8· Check yourself
Role R1 created table T1 and therefore owns it. R1 then grants SELECT on T1 to role R2. Which access control model does R1's ability to make that grant illustrate?
Under DAC, an object's owner can grant access to that object. RBAC describes R2 passing those privileges on to users, not the owner's right to grant them.
“Discretionary Access Control (DAC): Each object has an owner, who can in turn grant access to that object.”Source: docs.snowflake.com
Sources1
2.The securable object hierarchy and ownership
Every securable object sits inside a hierarchy of containers. The organization is at the top. Each account sits under it and holds all of its databases. Each database holds schemas. Each schema holds objects such as tables, views, functions and stages.
Ownership is what makes DAC work. Owning an object means a role holds the OWNERSHIP privilege on it. Each object has exactly one owner role, which is the role that created it unless ownership is changed. GRANT OWNERSHIP transfers ownership to another role, and that includes database roles. Every user who has the owner role shares control of the object.
In a regular schema, the owner role has every privilege on its object by default, including the right to grant or revoke privileges to other roles. A managed access schema centralizes those decisions instead. Object owners can no longer grant. Only the schema owner, or a role with the MANAGE GRANTS privilege, can grant privileges on objects in the schema, and that includes future grants.
One more ownership rule is easy to miss. Owning a *role* is not the same as inheriting from it. A role that owns another role does not get that role's privileges. Privileges are inherited only through the role hierarchy.
Checkpoint 2 of 8· Check yourself
Role ADMIN_X holds OWNERSHIP on role REPORTER, but REPORTER has not been granted to ADMIN_X. Which statement is true?
Owning a role and inheriting from it are separate things. A role inherits privileges only when the other role has been granted to it.
“A role owner (the role that has the OWNERSHIP privilege on the role) does not inherit the privileges of the owned role.”Source: docs.snowflake.com
Sources1
3.System-defined roles
Every account comes with a small set of system-defined roles. They cannot be dropped, and the privileges Snowflake grants them cannot be revoked. You can grant them extra privileges, but Snowflake recommends against it, because these roles hold account-management privileges and mixing those with privileges on specific objects is poor practice. If one of them needs more access, grant that access to a custom role and grant the custom role to the system-defined role.
The roles also form their own hierarchy. ACCOUNTADMIN contains both SYSADMIN and SECURITYADMIN, and USERADMIN is granted to SECURITYADMIN. Note that SECURITYADMIN's MANAGE GRANTS privilege only lets it grant and revoke. It does not let SECURITYADMIN create objects. For example, to create a database role, SECURITYADMIN also needs the CREATE DATABASE ROLE privilege.
| Role | Responsibility |
|---|---|
| ACCOUNTADMIN | Top-level role that contains SYSADMIN and SECURITYADMIN. Grant it only to a limited, controlled number of users |
| SECURITYADMIN | Manages any object grant globally through MANAGE GRANTS, and creates, monitors and manages users and roles. Inherits USERADMIN |
| USERADMIN | User and role management only. Holds CREATE USER and CREATE ROLE |
| SYSADMIN | Creates warehouses, databases and other objects. Can grant privileges on them to other roles when all custom roles roll up to it |
| PUBLIC | Pseudo-role automatically granted to every user and role. Anything it owns is available to everyone in the account |
PUBLIC is also the fallback role when a session starts. If the connection does not specify a role and the user has no default role, the session uses PUBLIC. PUBLIC suits cases where no explicit access control is needed and all users are treated equally.
Checkpoint 3 of 8· Exam question
Which statement accurately distinguishes Snowflake's discretionary access control (DAC) model from its role-based access control (RBAC) model?
Correct answer: A — In DAC, the owner of each securable object can grant privileges on that object to other roles, while in RBAC privileges are assigned to roles rather than directly to individual users.
- A. Correct. Snowflake combines DAC, where each object's owning role controls grants on that object, with RBAC, where privileges are assigned to roles and roles are granted to users rather than assigning privileges to users directly.
- B. Incorrect. This swaps the two models: DAC is defined by object ownership controlling grants, not by assigning privileges to roles, and RBAC does use roles rather than leaving decisions solely to owners.
- C. Incorrect. ACCOUNTADMIN is not required for every grant; any role with OWNERSHIP or the MANAGE GRANTS privilege can grant access, and RBAC does not eliminate the owner concept.
- D. Incorrect. Both DAC and RBAC apply across the full securable object hierarchy, from account-level objects like warehouses down to schema-level objects like tables; neither model is scoped to only one level.
Checkpoint 4 of 8· Match them up
Match each system-defined role to its job
Tap a term, then the definition that fits it.
Each system role covers one area of administration: users and roles, grants, objects, or access that everyone shares.
“Role that is dedicated to user and role management only.”Source: docs.snowflake.com
Sources1
4.Functional roles: account, database, and custom roles
The roles you create for business functions differ mainly in scope.
- An account role can be granted privileges on any object in the account. - A database role is limited to one database and the objects inside it. You grant it privileges on objects in that same database.
Any role you create yourself is a custom role. USERADMIN, any higher role, or any role with the CREATE ROLE privilege can create custom account roles. Custom database roles are created by the database owner. A new role starts out unattached: it is not granted to any user or to any other role.
Database roles have one important limit. They cannot be activated directly in a session. To use a database role's privileges, grant the database role to an account role, and activate the account role. The reverse grant is not allowed: account roles cannot be granted to database roles.
Checkpoint 5 of 8· Exam question
A data platform team creates a new schema `ANALYTICS.MARTS` and expects dozens of tables to be created in it over the coming months by an ETL pipeline running as role `ETL_LOADER`. They want the `REPORTING_RO` role to automatically receive SELECT on every table as soon as it is created, without re-running a GRANT statement each time. Which approach satisfies this requirement?
Correct answer: A — Issue a future grant with `GRANT SELECT ON FUTURE TABLES IN SCHEMA ANALYTICS.MARTS TO ROLE REPORTING_RO`, so Snowflake applies the privilege to tables at creation time.
- A. Correct. Future grants apply a privilege automatically to objects of the specified type that are created later in the schema, so every new table receives SELECT for the reporting role without additional manual grants.
- B. Incorrect. OWNERSHIP on a schema does not grant privileges on objects created by a different role inside it, and OWNERSHIP is a much broader privilege than the read-only access the reporting role needs.
- C. Incorrect. A recurring task could eventually catch up on new tables, but it introduces a delay window and operational overhead that a future grant avoids entirely by applying the privilege at creation time.
- D. Incorrect. Roles cannot be granted to a role via USAGE to inherit table privileges this way; role-to-role inheritance uses GRANT ROLE, and even then privileges on future objects still require a future grant.
Snowflake recommends building custom roles into a hierarchy whose top role is granted to SYSADMIN. That way system administrators can manage every object in the account, while user and role management stays with USERADMIN. If a custom role is left outside that hierarchy, SYSADMIN cannot manage its objects. Only roles with MANAGE GRANTS can then see those objects and change their grants, and by default that means only SECURITYADMIN.
Checkpoint 6 of 8· Exam question
An engineer runs `DROP ROLE FINANCE_ANALYST`, a custom role that owned several tables and views, without first reassigning ownership of those objects. What happens to the objects that role owned?
Correct answer: B — Ownership of the objects transfers automatically to the role that dropped `FINANCE_ANALYST`, since dropping a role requires the dropping role to already hold OWNERSHIP or MANAGE GRANTS on it.
- A. Incorrect. Snowflake does not leave objects permanently ownerless after a role is dropped; ownership is reassigned automatically as part of the drop operation, not left in an unmanageable state.
- B. Correct. When a role is dropped, Snowflake transfers ownership of the objects it owned to the role that issued the DROP ROLE statement, since that role must already hold sufficient privilege over the role being dropped.
- C. Incorrect. DROP ROLE does not require manually reassigning every owned object beforehand; Snowflake handles the ownership transfer automatically rather than blocking the statement.
- D. Incorrect. There is no rule tying ownership transfer to whichever role originally granted the dropped role its OWNERSHIP privilege; the transfer instead goes to the role executing the DROP ROLE command.
Checkpoint 7 of 8· Check yourself
Database role SALES_DB.READER holds SELECT on every table in SALES_DB. User U1 has only the account role ANALYST. What makes READER's privileges available to U1?
A database role can be neither a primary nor a secondary role. Its privileges reach a session only through an account role it has been granted to, and granting an account role to a database role is not allowed.
“Note that database roles cannot be activated directly in a session.”Source: docs.snowflake.com
Sources1
5.Primary and secondary roles in a session
A session always has exactly one primary role, but it can have any number of secondary roles active at once. The primary role comes from the role named in the connection, or from the user's default role, or from PUBLIC if neither is set. USE ROLE changes the primary role during the session. USE SECONDARY ROLES changes the secondary roles.
The two kinds of role authorize different things. CREATE statements are authorized only by the primary role, and every new object is owned by the primary role. For any other statement, privileges from the primary role, the secondary roles and all the roles they inherit are combined. This is why secondary roles are handy for cross-database joins: without them, you would need a parent role that held access to both databases. Database roles can never be primary or secondary roles.
USE SECONDARY ROLES {
ALL
| NONE
| <role_name> [ , <role_name> ... ]
}ALL activates every role granted to the user, in addition to the primary role. The set is worked out again for each statement, so roles granted mid-session take effect immediately and revoked roles stop working. NONE turns secondary roles off, which leaves the primary role as the only source of authorization. If you name specific roles instead, each one must already be granted to the user, or the command fails.
Checkpoint 8 of 8· Fill the gap
Which keyword activates every role granted to the user as a secondary role?
USE SECONDARY ROLES ? ;ALL activates every granted role in addition to the primary role, and the set is reevaluated for each statement. NONE turns secondary roles off.
Source: docs.snowflake.comExam traps
Each one states something that sounds right. Open it to see what is actually true.
1.A database role can be activated with USE ROLE or used as a secondary role.Why is that wrong?
A database role can be neither a primary nor a secondary role. You have to grant it to an account role, and only account roles can be activated in a session.
Covered in Functional roles: account, database, and custom roles
2.If a secondary role has the CREATE privilege in a schema, the user can create objects there.Why is that wrong?
CREATE statements are authorized only by the primary role, and the new object is owned by the primary role. Secondary roles only authorize other kinds of SQL actions.
Covered in Primary and secondary roles in a session
3.Because SECURITYADMIN holds MANAGE GRANTS, it can create any object in the account.Why is that wrong?
MANAGE GRANTS only lets SECURITYADMIN grant and revoke privileges. To create objects it needs the matching CREATE privilege, for example CREATE DATABASE ROLE.
Covered in System-defined roles
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Role-based Access Control (RBAC): Access privileges are assigned to roles, which are in turn assigned to users.”
↩︎ Three access control models in one framework“Access control considers privileges assigned directly to users only when USE SECONDARY ROLE is set to ALL.”
↩︎ Three access control models in one framework“The privileges associated with a role are inherited by any roles above that role in the hierarchy.”
↩︎ Three access control models in one framework“All access requires appropriate access privileges.”
↩︎ Three access control models in one framework“The top-most container is the customer organization.”
↩︎ The securable object hierarchy and ownership“Securable objects such as tables, views, functions, and stages are contained in a schema object, which are in turn contained in a database.”
↩︎ The securable object hierarchy and ownership“Each securable object is owned by a single role, which by default is the role used to create the object.”
↩︎ The securable object hierarchy and ownership“System-defined roles cannot be dropped.”
↩︎ System-defined roles“Snowflake recommends granting the additional privileges to a custom role and assigning the custom role to the system-defined role.”
↩︎ System-defined roles“It is the top-level role in the system and should be granted only to a limited/controlled number of users in your account.”
↩︎ System-defined roles“Role that can manage any object grant globally, as well as create, monitor, and manage users and roles.”
↩︎ System-defined roles“Role that has privileges to create warehouses and databases (and other objects) in an account.”
↩︎ System-defined roles“Pseudo-role that is automatically granted to every user and every role in your account.”
↩︎ System-defined roles“If no role was specified and a default role has not been set for the connecting user, the system role PUBLIC is used.”
↩︎ System-defined roles“To permit SQL actions on any object in your account, grant privileges on the object to an account role.”
↩︎ Functional roles: account, database, and custom roles“To limit SQL actions to a single database, as well as any object in the database”
↩︎ Functional roles: account, database, and custom roles“Custom account roles can be created using the USERADMIN role (or a higher role)”
↩︎ Functional roles: account, database, and custom roles“Custom database roles can be created by the database owner”
↩︎ Functional roles: account, database, and custom roles“Account roles cannot be granted to database roles in a role hierarchy.”
↩︎ Functional roles: account, database, and custom roles“if a custom role is not assigned to SYSADMIN through a role hierarchy, the system administrators cannot manage the objects owned by the role.”
↩︎ Functional roles: account, database, and custom roles“a session must have exactly one active primary role at a time, a session can activate any number of secondary roles”
↩︎ Primary and secondary roles in a session“Secondary roles are particularly useful for SQL operations such as cross-database joins”
↩︎ Primary and secondary roles in a session“Unless allowed by a grant, access is denied.”
↩︎ Key concept“A database role can be neither a primary nor a secondary role.”
↩︎ Exam trap 1“Authorization to execute CREATE <object> statements comes from the primary role only.”
↩︎ Exam trap 2“It does not give the SECURITYADMIN the ability to perform other actions such as creating objects.”
↩︎ Exam trap 3“Discretionary Access Control (DAC): Each object has an owner, who can in turn grant access to that object.”
↩︎ Checkpoint“However, in a managed access schema, object owners lose the ability to make grant decisions.”
↩︎ Prediction“A role owner (the role that has the OWNERSHIP privilege on the role) does not inherit the privileges of the owned role.”
↩︎ Checkpoint“Role that is dedicated to user and role management only.”
↩︎ Checkpoint“Note that database roles cannot be activated directly in a session.”
↩︎ Checkpoint - 2.
“Note that the set of roles is reevaluated when each SQL statement executes.”
↩︎ Primary and secondary roles in a session“Disables secondary roles. The authorization for all SQL actions is provided via the primary role.”
↩︎ Primary and secondary roles in a session