Snowflake masking policy and row access policy tests
A masking policy decides which value a reader sees in a column. A row access policy decides which rows the reader sees at all. Both are expressions that Snowflake evaluates at query time, for the role running the query, so you test them by reading the table as each role that matters.
Role matrix
List the roles before you write the policy: the owner, every privileged branch, and at least one restricted reader. For each role, write down what it should see, including a row whose value is NULL. Then query the protected table once per role and compare. A test run only as the administrator proves the privileged branch and nothing else.
CURRENT_ROLE and IS_ROLE_IN_SESSION
CURRENT_ROLE() returns the session’s primary role. IS_ROLE_IN_SESSION('ENGINEER') is true when ENGINEER is anywhere in the active role hierarchy, including roles the primary role inherits. If SYSADMIN inherits ENGINEER, a condition written as CURRENT_ROLE() = 'ENGINEER' masks SYSADMIN as well. Decide which behavior you want and test both roles.
NULL values and missing regions
In a row access policy, region = 'Northeast' is not true when the region is NULL, so that row stays hidden from restricted readers. That is usually what you want. Treating NULL as allowed discloses a row nobody approved. In a masking policy, decide whether a stored NULL should come back as NULL or as the replacement text, because the two say different things to the reader.
Secure views
A secure view hides its definition from users who do not own it. It does not mask anything by itself. Build it over the protected table, so the masking and row rules still apply, and grant SELECT on the view to the reader.
The policy boundaries lesson checks each policy for SYSADMIN, ENGINEER and ANALYST, and the governed delivery project applies both kinds of policy to a published table. Masking and row access policies need Enterprise Edition or higher.
References: Column-level security, Row access policies, IS_ROLE_IN_SESSION.