Forum Discussion
RLS security
- 2 years ago
Great I've added some fake email addresses and used UserPrincipalName to apply the filter:
testrls - sam.pbixYou can impersonate an email by entering it into Other user and ticking the role you want to test:
Hi eirika Can you share a sample file? It works on my test file but the stucture could be different.
hi,
thanks for your help
didn't find a way to include it here so uploaded a test file to
https://1drv.ms/u/s!Av4RVTN1GLuWgutkQzhr1KeJEP7bVQ?e=2MOgoq
- SamWiseOwl2 years agoSuper User
Hi eirika
How will the filtering work on publish?
Are you going to add emails into the Access table next to their UserId?
- eirika2 years agoFrequent Visitor
No, I'm using the embedded solution.
So when the code call the EffectiveIdentity method from the application to open the PowerBI report we pass the role "User" and the value of "userId" for the logged in user. This give us possibility to use the username() function in RLS to get the userId value.
So the filter on the useraccess table in my example is hard coded to 1, this number will be replaced with username() on deploy.
the access table is only for limiting the rows the user has access to in t1 and t2. There will bo no extra columns.
- eirika2 years agoFrequent Visitor
I did get it to work now by using the filter below on t1 and t2 (replaces username() with hard coded value 1). But is this a nice and fast solution?
t1[access_id] IN CALCULATETABLE(DISTINCT(access[access_id]), access[userid] = USERNAME())