Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Implement table- and column-level access control and row-level security

A worked example

Yes or no

Contoso stores data in two Unity Catalog tables: sales.core.customers, which has an email column, and sales.core.orders. A data engineer owns both tables and has SELECT on both. Neither table has a row filter or column mask yet. Three teams have requirements:

  • R1 (reporting team): Query one object that combines customer and order data. The email value must be redacted unless the user is in the privacy group. The team must not get any privileges on either base table. The team already has USE CATALOG on sales and USE SCHEMA on sales.core.
  • R2 (support team): Update rows in orders.
  • R3 (compliance): email must be redacted for every user outside the privacy group who queries customers. This includes the data_engineers group, which has SELECT directly on customers.

The data engineer will create any views.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

StatementYesNo
A single dynamic view that joins customers and orders and uses a CASE expression to redact email, with SELECT on the view granted to the reporting team, meets R1.

A dynamic view can combine several tables and apply masking in one place. Users with permission on the view can query it without direct access to the base tables, because the view owner has that access.

Correct
If the support team is granted SELECT on a dynamic view over orders, the team can update order rows through that view without any privileges on the orders table.

Views cannot be updated. Any data modification still needs access to the base table, so the view does not meet R2.

Correct
A dynamic view over customers that redacts email for users outside the privacy group meets R3.

A dynamic view leaves the base table unrestricted. Members of data_engineers who are outside the privacy group would still see real email values if they queried customers directly. A column mask on customers can apply the redaction to direct queries.

Correct
Why

Dynamic views suit R1 because they can join several tables, apply masking in one definition, and let users query the view without privileges on the base tables, provided the view owner has access. They are read-only, so they cannot meet a requirement to update rows through the view (R2). They also leave the base table unrestricted, so a view cannot enforce masking for users who query customers directly (R3). A column mask on customers can redact email for users outside the privacy group even when they query the table directly.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free