liveBook · Manning

CREATE ROLE privilege

As explained in Snowflake Data Engineering

The CREATE ROLE privilege permits a role to create custom access-control roles.

The CREATE ROLE privilege permits a role to create custom access-control roles. USERADMIN has this privilege, and other roles can receive it. After creation, each role must be granted to a user or another role before it takes effect. A role hierarchy can place access roles beneath functional roles and grant the top-level custom role to SYSADMIN, allowing inherited privilege management. section 10.1.2

Apply the privilege in an RBAC setup by separating role creation from object privilege grants:

  • Switch to USERADMIN or another role with CREATE ROLE, then create access and functional roles. section 10.1.3
  • Switch to SECURITYADMIN or a role with MANAGE GRANTS to assign database, schema, table, view, and future-object privileges. section 10.1.3
  • Grant access roles to functional roles, then grant functional roles to SYSADMIN or users as required. section 10.1.2 section 10.1.3

Create bakery RBAC roles

use role USERADMIN; create role BAKERY_FULL; create role BAKERY_READ; create role DATA_ENGINEER; create role DATA_ANALYST; section 10.1.3

Figure 10.1 Role-based access control configuration of the environment used in the example in this chapter. The environment includes two functional roles, DATA_ENGINEER and DATA ANALYST, and two access roles, BAKERY_FULL and BAKERY_READ. Access roles are granted to functional roles, and functional roles are granted to the SYSADMIN role.
figure

Role hierarchy diagram showing access roles granted to functional roles and functional roles granted to SYSADMIN. section 10.1.3

How Snowflake Data Engineering covers it

How deep it goes
Explains role creation and follows it through grants and hierarchy, without detailing privilege implementation internals.
Examples
Uses USERADMIN to create BAKERY_FULL, BAKERY_READ, DATA_ENGINEER, and DATA_ANALYST.
What it assumes
Assumes a Snowflake account with administrative roles and demonstrates the USERADMIN role switch required before creating roles.
What you can do after
Operate/configure Snowflake RBAC by creating custom roles and assigning later privilege grants through the appropriate administrative roles.
How it connects
Connects custom roles with role hierarchy, privilege inheritance, managed access schemas, and MANAGE GRANTS.

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.