The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
How can we implement the RLS, so that the users linked with the particular guid lets say 1001, can see each others report when filtered with the RLS email address, and the users belonging to the company id 1002 do not see the details of 1001 company id when they loged in??
Solved! Go to Solution.
Hi @Anmolgan,
It works same as username.
You can use username function to find out user, then use user to find related company.
In RLS expression, you can use above company id as filter parameter to apply security filter effect.
Logic:
1. Username -> user id.
2. User id -> company
3. User id and company id as filter condition.
If you still not clear for this, you can share some sample data and I will add these expression to your sample.
Regards,
Xiaoxin Sheng
Hi @Anmolgan,
I think you need to create/add guid to user email table to achieve email - guid mapping.
After these steps, you can refer to below link to know how to create dynamic RLS based on username function.
Notice: please remember to turn on the 'apply security filter in both directions' option at edit relationship panel.
Regards,
Xiaoxin Sheng
Can you explain this in depth as I want to user [user table]= username() here and also the [comapnyid]= "value provided by the user" if user a b belongs to comapny 1001 and c belongs to 1002, then if user a logs in then he should also be able to see the user b's data, how can I achive this scenerio??
The links which you have only talks about the username() function, and dynamic row level security, I was able to create the below relationship and using the Company[COMPANYID] to sort but how to sort all this together with email? so that all the users belonging to 1001 group id can see each others report??
Hi @Anmolgan,
It works same as username.
You can use username function to find out user, then use user to find related company.
In RLS expression, you can use above company id as filter parameter to apply security filter effect.
Logic:
1. Username -> user id.
2. User id -> company
3. User id and company id as filter condition.
If you still not clear for this, you can share some sample data and I will add these expression to your sample.
Regards,
Xiaoxin Sheng
How can I share my .pbix file here??
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
141 | |
109 | |
108 | |
76 | |
63 |
User | Count |
---|---|
270 | |
129 | |
123 | |
100 | |
92 |