Building a Data Stack Live with AI AgentsLivestream August 18

Skip to main content

SHOW roles and membership

Requires permissionRoles and access control →
View organization-wide role membershipAdmin ✓Builder —Explorer —

Marked preset roles include the permission by default; a custom role qualifies when it inherits a role that includes it. Applies to inspecting other members and roles; without it, users can inspect only roles they belong to and their own assignments. SHOW ALL ROLES needs no permission.

These read-only commands report the state of roles and membership. They do not change any access. Listing a role name does not grant access to it. See Roles and access control for the model.

The OF and TO keywords set the direction of the lookup, matching Snowflake's SHOW GRANTS semantics:

  • OF ROLE walks down: the users and roles that hold the role.
  • TO ROLE and TO USER walk up: the roles a role or user inherits, transitively.

SHOW ALL ROLES​

List every role in the organization, both preset and custom. Any member can run this command and sees role names only, with no membership details.

SHOW ALL ROLES;

Output columns:

ColumnDescription
role_nameName of the role.
role_typepreset or custom.
included_rolesThe roles this role inherits directly.
created_atWhen the role was created.

SHOW USERS OF ROLE​

List the users and service accounts that hold a role directly.

SHOW USERS OF ROLE finance;

Output columns:

ColumnDescription
usernameMember or service account name.
emailMember email.
is_service_accounttrue for a service account.
granted_atWhen the role was assigned.

SHOW ROLES OF ROLE​

List the roles that hold a role directly, that is, the roles that inherit from it.

SHOW ROLES OF ROLE finance;

Output columns:

ColumnDescription
role_nameName of a role that inherits this role.
role_typepreset or custom.
granted_atWhen the inheritance was established.

SHOW ROLES TO ROLE​

List the roles a role inherits, walking up the hierarchy transitively.

SHOW ROLES TO ROLE finance;

Output columns:

ColumnDescription
role_nameName of an inherited role.
role_typepreset or custom.
is_directtrue when the role is inherited directly, false when inherited through another role.
granted_atWhen a direct inheritance was established. NULL for a transitively inherited role.

SHOW ROLES TO USER​

List every role assigned to a user, walking up the hierarchy transitively. Useful for auditing what a user can access.

SHOW ROLES TO USER alice;

Output columns:

ColumnDescription
role_nameName of an assigned role.
role_typepreset or custom.
is_directtrue when the role is assigned directly, false when inherited through another role.
granted_atWhen a direct assignment was made. NULL for a transitively inherited role.