web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Use Liquid to get Web ...
Power Pages
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

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    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.

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    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

  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    @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.

  • paulsnolan Profile Picture
    179 on at

    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.

  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    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

    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?

    NavigationIcons.jpg
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 47 Super User 2026 Season 1

#2
SP2019admin Profile Picture

SP2019admin 20

#3
Mohsin Ali Profile Picture

Mohsin Ali 19

Last 30 days Overall leaderboard