Forum Discussion
Not able to get RLS to work on a second table
- 8 years ago
Ah, I see, so you should in best practise use the same security filter as in certain cases one will counter act the other. If you disable that security filter does this one work? What are you filtering on the other one?
- Anonymous8 years ago
Thanks for your assistance on this one. I deleted the relationship between the two tables and the RLS works well independently. You touched on what I believe to be the issue though, that is the RLS should use the same security filter or one will counter the other. In addition, if the tables do not need to be related then independent RLS is possible.
Thanks again!
Hi Anonymous
A couple of things you could check to begin with, the data type of the value you are filtering. Ensure this is a text value accross the board.
Also, add the column to the page filter of your report and test that it works by just selecting and applying that filter.
Can you share the code you have used in your role filter please?
Thanks
shebr
Verified text column values within both tables. Also added the "ORGN_CODE" filter at the page level, which does filter down the results to 10100 only.
Here is the DAX code I've tried: [ORGN_CODE] = "10100"
Thanks for the assist!
- shebr8 years agoResolver III
Hi Anonymous
Ok great, so then im assuming you select the 'view as' options and select that role and you dont see the filtered value?
Can you check your relationship to this table next, double click on the relationship and there is an option where you can select 'apply security in both directions'. Click this and test the 'View as' role again.
Let me know how you get on.
Thanks
shebr
- Anonymous8 years agoNot applicable
Correct. I checked the relationship on the transactions and selected the 'apply security in both directions option and received the following error:
'Table 'other_table_name' is configured for row-level security, introducing constraints on how security filters are specified. The setting for Security Filter Behavior on relationship '659f392c-a2c8-45dd-b69a-8319bc2d9a81' cannot be Both.
Just to be clear, there is active RLS on the other table which is already working correctly.
- shebr8 years agoResolver III
Ah, I see, so you should in best practise use the same security filter as in certain cases one will counter act the other. If you disable that security filter does this one work? What are you filtering on the other one?
- Anonymous8 years agoNot applicable
Thanks for your assistance on this one. I deleted the relationship between the two tables and the RLS works well independently. You touched on what I believe to be the issue though, that is the RLS should use the same security filter or one will counter the other. In addition, if the tables do not need to be related then independent RLS is possible.
Thanks again!