Which function should be used to authorize users to access rows in a base table when using secure views with Secure Data Sharing?
Which function should be used to authorize users to access rows in a base table when using secure views with Secure Data Sharing?
When using secure views with Secure Data Sharing, the function CURRENT_ACCOUNT() should be used to authorize users to access rows in a base table. This is because CURRENT_ACCOUNT() identifies the account context of the user querying the data, which is necessary for secure data sharing where the account context must be maintained. Using CURRENT_ROLE() or CURRENT_USER() would not be appropriate in this context as they return NULL when the view is shared across different Snowflake accounts.
The correct answer is A. CURRENT_ACCOUNT() Secure Views and Data Sharing When using secure views with Secure Data Sharing, use the CURRENT_ACCOUNT function to authorize users from a specific account to access rows in a base table. ------------------------------------------------------------------------------------------------------------------------------- Note: When using the CURRENT_ROLE and CURRENT_USER functions with secure views that will be shared to other Snowflake accounts, Snowflake returns a NULL value for these functions. The reason is that the owner of the data being shared does not typically control the users or roles in the account with which the view is being shared. https://docs.snowflake.com/en/user-guide/views-secure#secure-views-and-data-sharing
https://docs.snowflake.com/en/user-guide/views-secure#secure-views-and-data-sharing
A Current Account