nerdexam
Snowflake

ARA-C01 · Question #136

Which command will you run to list all privileges and roles granted to the role?

The correct answer is D. SHOW GRANTS TO ROLE <ROLE NAME>. SHOW GRANTS TO ROLE lists all privileges on securable objects and all roles that have been granted to the specified role in Snowflake.

Security and Compliance

Question

Which command will you run to list all privileges and roles granted to the role?

Options

  • ASHOW GRANTS FOR ROLE <ROLE NAME>
  • BSHOW GRANTS OF ROLE <ROLE NAME>
  • CSHOW GRANTS ON ROLE <ROLE NAME>
  • DSHOW GRANTS TO ROLE <ROLE NAME>

How the community answered

(19 responses)
  • B
    5% (1)
  • C
    5% (1)
  • D
    89% (17)

Why each option

SHOW GRANTS TO ROLE lists all privileges on securable objects and all roles that have been granted to the specified role in Snowflake.

ASHOW GRANTS FOR ROLE <ROLE NAME>

SHOW GRANTS FOR ROLE is not valid Snowflake SQL syntax and will return a parsing error.

BSHOW GRANTS OF ROLE <ROLE NAME>

SHOW GRANTS OF ROLE <name> shows which users or other roles have been granted the named role - the inverse direction - not the privileges held by the role itself.

CSHOW GRANTS ON ROLE <ROLE NAME>

SHOW GRANTS ON ROLE <name> lists privileges that have been granted on the role object itself, such as who holds the OWNERSHIP privilege on it, not what the role is permitted to access.

DSHOW GRANTS TO ROLE <ROLE NAME>Correct

SHOW GRANTS TO ROLE <name> returns every privilege on securable objects (tables, schemas, databases, etc.) and every role that has been directly granted to the named role, making it the correct command to audit what a role is authorized to do.

Concept tested: Snowflake SHOW GRANTS command variants for role privilege inspection

Source: https://docs.snowflake.com/en/sql-reference/sql/show-grants

Topics

#SQL command#Role-Based Access Control#Grants#SHOW GRANTS

Community Discussion

No community discussion yet for this question.

Full ARA-C01 Practice