Configuring static row-level security
Static row-level security applies the filter to all members of the role. Roles can have filters on multiple tables. This recipe demonstrates this by adding a new filter on the Read_Ice role already created on the model.
Getting ready
Open the Crash_Data_Model in Visual Studio to bring up Model.bim. Then, change your view to the Diagram view to see the table relationships. In this recipe, you will review how row-level security is added and how it works. You will add a filter on the LIGHT_T table and then add a filter on the CRASH_DATA_T table.
![](https://static.packt-cdn.com/products/9781786468611/graphics/image_07_001.jpg)
In SQL Server Management Studio, the current security is only limiting rows to Ice conditions.
![](https://static.packt-cdn.com/products/9781786468611/graphics/image_07_002.jpg)
How to do it...
Select the Model menu and then Roles to bring up the Role Manager window.
Select Read_Ice to see the row filter already applied.
In the DAX Filter area for the LIGHT_T table enter:
=LIGHT[LIGHT_CONDITION]="Dawn"
Deploy the model and review the results in SQL Server Management Studio.