nerdexam
Snowflake

ADA-C01 · Question #49

A company's Snowflake account has multiple roles. Each role should have access only to data that resides in the given role's specific region. When creating a row access policy, which code snippet…

The correct answer is C. create or replace row access policy region policy as (region_value varchar) returns boolean ->. This code snippet will create a row access policy that returns true if the current role is ALL_ACCESS_ROLE or if the current role matches the region value in the entitlement_table. This means that the ALL_ACCESS_ROLE can see all rows regardless of region, while the other roles…

Data and Access Management

Question

A company's Snowflake account has multiple roles. Each role should have access only to data that resides in the given role's specific region. When creating a row access policy, which code snippet below will provide privileges to the role ALL_ACCESS_ROLE to see all rows regardless of region, while the other roles can only see rows for their own regions?

Options

  • Acreate or replace row access policy region policy as (region_value varchar) returns boolean ->
  • Bcreate or replace row access policy region policy as (region_value varchar) returns boolean ->
  • Ccreate or replace row access policy region policy as (region_value varchar) returns boolean ->
  • Dcreate or replace row access policy region policy as (region_value varchar) returns boolean ->

How the community answered

(41 responses)
  • A
    2% (1)
  • B
    10% (4)
  • C
    80% (33)
  • D
    7% (3)

Explanation

This code snippet will create a row access policy that returns true if the current role is ALL_ACCESS_ROLE or if the current role matches the region value in the entitlement_table. This means that the ALL_ACCESS_ROLE can see all rows regardless of region, while the other roles can only see rows for their own regions. According to the Snowflake documentation, the CURRENT_ROLE context function returns the name of the current role for the session. The EXISTS function returns true if the subquery returns any rows. The OR operator returns true if either operand is true. Therefore, this code snippet satisfies the requirements of the question.

Topics

#row access policy#role-based filtering#data security#policy syntax

Community Discussion

No community discussion yet for this question.

Full ADA-C01 Practice