Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Unanswered

Use Liquid to get Web Page Access Control Rules associated with a Web Role

(0) ShareShare
ReportReport
Posted on by 179

Hi All

 

Using the following Liquid code I can get the current user's Web Roles

 

<br />

This user has the following web roles:

<br /><br />

<ul>

    {% if user %}

        {% for role in user.roles %}

            <li>{{ role }}</li>

        {% endfor %}

    {% endif %}

</ul>

 

Can I do something similar to get the Web Page Access Control Rules associated with the Web Role?

 

Thanks

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    Please see here on how to use WebLinks via Liquid: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#weblinks

    you can also refer to the Header/Footer Web Templates to see more examples

     

    You can create your own Web Link Set and add your Links there

     

    I would recommend doing something very simple first, just to test the Access Control Rules.. don't bother with the icons, just call the web link set and render the links, and check the permissions

    if that works fine, then you can play around with adding the icons etc

  • paulsnolan Profile Picture
    179 on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    Hi Oliver

     

    We are using <a> tags e.g.

     

            <a href="{{ sitemarkers["Account Cards"].url }}">

               <img src="/AccountCards.png" style="width:200px; height:200px;">

            </a>

     

    Attached is how the images appear in the body of the page, they are not in the footer. This is just specific to one page.

     

    We have a normal navigation menu in the page header of each page.

     

    How would we use web links for just the one page?

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    Hi, those icons should be using Web Links + images within the Web Links

    When using Web Links, this will also be validated against the Web Roles/Web Page Access Control Rules.. so basically the icon/link won't appear if they don't have access

     

    Are you using Web Links to render your footer? 

  • paulsnolan Profile Picture
    179 on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    Hi Oliver

    We are investigating possibilities regarding navigation using icons in a page footer. We have a number of icons whereby if you click one you are taken to a particular page. Each of the pages have a Web Page Access Control Rule. We also have some web roles which group these Web Page Access Control Rules together by function. A user will have one or more of these roles. What we are looking at is how to disable/hide an icon if the user doesn't have the appropriate access. We can do this by role, but our roles have more than one Web Page Access Control Rule. We are looking at what possibilities are available using roles and rules.

  • Fubar Profile Picture
    8,021 Super User 2025 Season 1 on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    @ragavanrajan  you probably can get it by making a fetchxml query and the appropriate entity permissions - but I don't know that I would recommend it.

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    Hi @paulsnolan we can't access that via Liquid objects, but I am curious to why you would need, can you give more details on your requirement? 

    If you setup a Web Page Access Control Rule for a page, basically you don't want the user to see that page, so I am not sure how accessing that via Liquid would help

  • ragavanrajan Profile Picture
    7,036 Most Valuable Professional on at
    Re: Use Liquid to get Web Page Access Control Rules associated with a Web Role

    Hi @paulsnolan , 

     

    I don't think you can get that via liquid syntax. Below is the reference of available liquid objects. 

     

    https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects?source=docs 

     

    ------------

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35