add_dynamic_rls
Generate dynamic row-level security by creating a role (if needed) and setting a USERPRINCIPALNAME()-driven filter on a target table, supporting direct, bridge, hierarchy, or lookup shapes.
Instructions
Generate dynamic row-level security: create the role (if absent) and set a USERPRINCIPALNAME()-driven filter on the SECURED table. shape = direct | bridge | hierarchy | lookup. Never targets the user/mapping table (refused - it would break the lookup).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | Yes | role name | |
| shape | Yes | direct | bridge | hierarchy | lookup | |
| sessionId | Yes | ||
| userTable | Yes | the user/security mapping table | |
| pathColumn | No | path column on the user table for the hierarchy shape (optional) | |
| securedTable | Yes | the fact/dimension table to secure | |
| securedColumn | Yes | the column on the secured table to filter | |
| modelPermission | No | model permission for a new role (default Read) | |
| userEmailColumn | Yes | the email/UPN column on the user table | |
| userValueColumn | Yes | the value column on the user table that matches the secured column |