Forum Discussion

Titatovenaar2's avatar
Titatovenaar2
Icon for Advocate II rankAdvocate II
5 years ago
Solved

RLS: Conditional Navigation, hiding buttons (.pbix included)

Hi guys,

 

I am currently creating a report in which I use buttons to navigate through pages, using row-level security (RLS).

These buttons should only be visible when a user has the correct authorization/security rights to do so.

 

For a part I have been able to make it work: the buttons only navigate to a page when you have sufficient security rights.

However, I want them to disappear entirely if you don't have the rights.

 

I've created a very simplistic .pbix file to showcase this. This is with january 2021 update, however.

 

I've created the table 'Users' with 2 users in it, user 'test' and user 'admin'. If you navigate to Modeling>View as and enter here 'test' and select 'Page' with it, you'll notice the security works.

The buttons have the following DAX logic behind them:

Button 2 Destination = 
MAXX (
    FILTER (
        ADDCOLUMNS (
            'Page Level Security',
            "Rank", RANKX ('Page Level Security',[Order],,ASC)
        ),
        [Rank] = 2 //change this number with button number
    ),
    [Page Name]
)

For button 'Home' which is the first button, replace the 2's with 1's.

 

Do you have any suggestions what I am missing to make the buttons themselves disappear?

 

Kind regards,

Igor