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

Community site session details

Session Id : mLYHdnYpGx8vjOdeBF+9DW
Power Pages - Power Apps Portals
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 10 May 2021 16:29:02 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

I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,347 Most Valuable Professional on 12 May 2021 at 08:44:31
    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 12 May 2021 at 07:37:10
    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,347 Most Valuable Professional on 11 May 2021 at 19:21:16
    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 11 May 2021 at 08:25:05
    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,133 Super User 2025 Season 2 on 10 May 2021 at 22:28:54
    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,347 Most Valuable Professional on 10 May 2021 at 19:37:03
    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 10 May 2021 at 18:36:37
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Pages

#1
Jon Unzueta Profile Picture

Jon Unzueta 82 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 2

#3
Shafiuddin Profile Picture

Shafiuddin 45

Last 30 days Overall leaderboard