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.
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)- B5% (1)
- C5% (1)
- D89% (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.
SHOW GRANTS FOR ROLE is not valid Snowflake SQL syntax and will return a parsing error.
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.
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.
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
Community Discussion
No community discussion yet for this question.