RLS adds restrictions to access data by users.
There are 2 ways to add RLS.
- Create a user filter and map users to values manually.
- Create a dynamic filter using a security field in the data.
The whole steps by step are explained here
Using user filter
In Tableau Desktop, open the workbook, or create a new one, and set up the connection to the data you want to filter.
Navigate to the worksheet that you want to apply a filter to.
Select Server > Create User Filter. Then select the field you want to use for filtering the view. This example uses Region.
If prompted, sign in to your server or site.
In the User Filter dialog box, type a name for the set of rules you are creating.
In this example, we’ll use Regional Managers.
In the list on the left, select a user or group. On the right, select the individual members of the field you selected earlier, that you want the selected users to be able to see.
Using dynamic filter
In Tableau Desktop, open the workbook you want to add user filtering to, or create a new one, connecting to the data you want to filter.
In this example, we use a table called Orders.
On the Data Source page, add the reference table, creating a left join. Here we add the People table and create a left join on the Region field.
Go to the worksheet, select Analysis > Create Calculated Field, and create the following field:
- Name: User is a manager
- Formula: USERNAME() = [Manager]
Add the User is a manager field to the Filters shelf.
In the Filter dialog box, select True, and then click OK.
This sets the filter so that only people who are managers can see the data in the view.
If you are not listed in the Manager field, your view might appear as a blank canvas.
See how the view looks to a particular person: in the lower-right, open the Filter as User menu, and select someone you know is a manager.