nerdexam
Snowflake

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…

Security and Governance

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)
  • A
    8% (4)
  • B
    12% (6)
  • C
    4% (2)
  • D
    76% (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

#Column-level masking#Role hierarchies#Access control#Context functions

Community Discussion

No community discussion yet for this question.

Full DEA-C02 Practice