ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 68 - ADA-C01 discussion

Report
Export

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?

A.
create or replace row access policy region policy as (region_value varchar) returns boolean -> 'ALL ACCESS_ROLE' = current_role () and exists ( select 1 from entitlement_table where role = current_role () and region = region_value )
Answers
A.
create or replace row access policy region policy as (region_value varchar) returns boolean -> 'ALL ACCESS_ROLE' = current_role () and exists ( select 1 from entitlement_table where role = current_role () and region = region_value )
B.
create or replace row access policy region policy as (region_value varchar) returns boolean -> exists ( select 1 from entitlement_table where role = current_role () and region = region_value )
Answers
B.
create or replace row access policy region policy as (region_value varchar) returns boolean -> exists ( select 1 from entitlement_table where role = current_role () and region = region_value )
C.
create or replace row access policy region policy as (region_value varchar) returns boolean -> 'ALL_ACCESS_ROLE' = current_role () or exists ( select 1 from entitlement_table where role = current_role () and region = region_value )
Answers
C.
create or replace row access policy region policy as (region_value varchar) returns boolean -> 'ALL_ACCESS_ROLE' = current_role () or exists ( select 1 from entitlement_table where role = current_role () and region = region_value )
D.
create or replace row access policy region policy as (region_value varchar) returns boolean -> 'ALL ACCESS ROLE' = current_role () )
Answers
D.
create or replace row access policy region policy as (region_value varchar) returns boolean -> 'ALL ACCESS ROLE' = current_role () )
Suggested answer: C

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 theSnowflake 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.

asked 23/09/2024
Ernest Altagracia Marte
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first