Forum Discussion

P3Sven's avatar
P3Sven
Icon for Advocate I rankAdvocate I
4 years ago
Solved

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

  • Hi P3Sven 


    What I have done in the past is to have both versions of the email/UPN in the RLS that way which ever one gets passed still works?

    • P3Sven's avatar
      P3Sven
      Icon for Advocate I rankAdvocate 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's avatar
        P3Sven
        Icon for Advocate I rankAdvocate 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.