Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

RLS with two o more roles

Hello all!!

I have this situation, im not sure how to handle,

I have a User table where is the list of person by country, they can see the information of this countries, for example: Juan can see the information of ES, IT, FR and UK and Pedro, the information of ES, IT, and FR.

Name

Email

Country ID

Juan

[email protected]

ES

Juan

[email protected]

IT

Juan

[email protected]

FR

Juan

[email protected]

UK

Pedro

[email protected]

ES

Pedro

[email protected]

IT

Pedro

[email protected]

FR

 

Then, I created a Measure to determine who can see the countries; this is the measure.

CanSeeCountries = CALCULATE(COUNTROWS(users),Users[Email]=USERPRINCIPALNAME())

This measure was added in the users table in the definition of the roles.

 

Also, I have different roles, for regions, areas, etc. and the users can have one, or two different roles.

The problem is when assigned two o more roles to one user, I get this error:

 

For example, one case, is for Pedro, I try the role, with his user, then assign the NorthProcurement Rol, and its ok, then assign the SubAreaOffice rol and I get the error message.

Im including and example in pbi, i hope someone can help me.

https://drive.google.com/file/d/1hpvY4HpB3qvcfzNYT1S7RSm9XAcYpG3A/view?usp=sharing

Thanks for the help

Monica

5 Replies

  • Anonymous , I have unchecked "Apply Security filter in both directions" in relation to the Country users and it is working.

     

    Try that

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi amitchandak 

    Thanks for your answer,

    I tried with this option, but don´t filter the countries, for example, I tried with [email protected] and gives me access to all countries, pedro has access to ES, IT, and FR, but give me UK too.

    Thanks again.

    Monica

    • amitchandak's avatar
      amitchandak
      Icon for Super User rankSuper User

      Anonymous , which roles you have selected?

       

      When you select more than one role it OR between two roles. So data will be based on that

      • Anonymous's avatar
        Anonymous
        Not applicable

        Im using this test:

        I was expecting that Pedro can see, only the 3 countries that have in the table of users.

        Thanks, for the help.

        Greetings,