Forum Discussion
Row Level Security | Userprincipalname() for Guest Account
Hi lovely community,
I've a Report with RLS Group invited "All Users" cause I've a dynamic RLS Table saved in Dataverse with all Users should able to see RLS content.
RLS Filter in Power BI: [Email] = USERPRINCIPALNAME()
Works fine for the most Guest Accounts, but we have some Users with "mail#[email protected]" instead of "[email protected]" as Userprincipalname(). Don't know why there's a prefix of "mail#".
So I just created a new column with "mail#" + Email in our RLS Table for the "right" Userprincipalname.
New RLS Filter in Power BI: [Email] = USERPRINCIPALNAME() || [Custom Email] = USERPRINCIPALNAME()
But also with this its not working.
So I guess its not cause the Guest Account is not a part of "All Users". I also use "All Users" for Report Access and this is working.
So why RLS is not working with the Custom Mail and why there are Guest Accounts with "mail#" ?
BR,
Sven
Have found my fail, just had wrong RLS Formula. "Userprincipalname()" instead of Userprincipalname() 😕
Anyway it's hard to understand where the "right" Userprincipalname() in Dataverse is saved or whether theres another name not saved in Dataverse.
6 Replies
- P3Sven
Advocate I
Hi GilbertQ ,
I've created RLS Role with 3 options out of systemuser dataverse table:
- dominname (normaly = USERPRINCIPALNAME(), but for Guest Account something with #EXT)
- internalemail (just the normal emailadress)
- custom mail (Custom added column with mail# + email, cause its not in systemuser dataverse table available, but is showing in Power BI as USERPRINCIPALNAME())
Unfortunately my custom email column is not working although USERPRINCIPALNAME () is showing exactly the same and should be filtered in RLS.
BR,
Sven
- P3Sven
Advocate I
Have found my fail, just had wrong RLS Formula. "Userprincipalname()" instead of Userprincipalname() 😕
Anyway it's hard to understand where the "right" Userprincipalname() in Dataverse is saved or whether theres another name not saved in Dataverse.
- GilbertQ
Super User
- v-robertq-msft
Community Support
Hi,
According to your requirement, I think you can refer to this blog and check if it can be helpful:
https://superfarb.com/power-bi-row-level-security-while-sharing-with-external-users/
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.