DEA-C02 · Question #39
Within a Snowflake account. permissions have been defined with custom roles and role hierarchies. To set up column-level masking using a role in the hierarchy of the current user, what command would…
The correct answer is D. IS_GRANTED_TO_INVOKER_ROLE. IS_GRANTED_TO_INVOKER_ROLE('<role>') is the correct choice because it specifically checks whether a given role exists anywhere in the invoker's role hierarchy - not just their active role - making it the right tool for masking policies that should apply to inherited roles. It…
Question
Within a Snowflake account. permissions have been defined with custom roles and role hierarchies. To set up column-level masking using a role in the hierarchy of the current user, what command would be used?
Options
- ACURRENT_ROLE
- BINVOKER_ROLE
- CIS_ROLE_IN_SESSION
- DIS_GRANTED_TO_INVOKER_ROLE
How the community answered
(49 responses)- A8% (4)
- B12% (6)
- C4% (2)
- D76% (37)
Explanation
IS_GRANTED_TO_INVOKER_ROLE('<role>') is the correct choice because it specifically checks whether a given role exists anywhere in the invoker's role hierarchy - not just their active role - making it the right tool for masking policies that should apply to inherited roles. It returns a boolean, which is exactly what a masking policy condition needs.
Why the distractors are wrong:
- A. CURRENT_ROLE returns only the single active primary role as a string; it doesn't traverse the hierarchy, so inherited roles are invisible to it.
- B. INVOKER_ROLE is not a valid standalone Snowflake function; it's a distractor that sounds plausible by combining familiar terms.
- C. IS_ROLE_IN_SESSION checks whether a role is currently active in the session (relevant for secondary roles), not whether it exists in the granted role hierarchy - a subtle but important distinction.
Memory tip: Think of the phrase "was this role granted down to the person invoking this query?" - that maps directly to IS_GRANTED_TO_INVOKER_ROLE. If the question involves hierarchy traversal in a masking policy, "GRANTED TO INVOKER" is the answer.
Topics
Community Discussion
No community discussion yet for this question.