1. A data engineer creates the following view in Unity Catalog: CREATE VIEW finance.reporting.employee_salaries AS SELECT employee_id, department, CASE WHEN is_account_admin() OR current_user() = manager_email THEN salary ELSE NULL END AS salary FROM finance.hr.salaries; What is the PRIMARY security pattern this view implements?
- A. Row-level security — hiding specific rows from unauthorized users
- B. Column-level security — masking a sensitive column based on the identity of the querying user✓ Correct
- C. Schema-level security — preventing users from seeing the schema of the underlying table
- D. Table-level security — blocking direct access to the underlying table entirely
Explanation
The view returns all rows but replaces the salary column value with NULL for users who are neither account admins nor the relevant manager. This is column-level security (also called column masking) — the column is present in the result but its value is hidden/masked based on user identity. It is not row-level security (option A) because no rows are filtered out with a WHERE clause; all rows are returned, just with masked values for unauthorized users. Schema-level security (option C) would mean preventing users from viewing the schema definition, which this view does not do. Table-level security (option D) would mean blocking access to the base table entirely through REVOKE or permission denial, not through a view that still returns all rows.