Power Apps Portals – How to Show the Menu Link for a Restricted Page

As part of a continuing effort to provide more Power Apps portals configuration functionality, Microsoft has recently added the ability to add web page permissions directly in the Portals Studio.

You can read about the announcement here:

https://powerapps.microsoft.com/blog/power-apps-portals-manage-page-permissions-from-portals-studio/

The process is really straight forward and doesn’t need a blog post to explain it. You simple choose if the page is available to all users or select which roles have access to the page;

New Web Page Permissions

However, if you don’t plan to use the existing Administrators or Authenticated Users web roles, you will still need to go to the Portal Management app and create a custom web role.

Create a custom web role

Once you apply the permissions to the web page on the Portal studio, it will create a “Web Page Access Control Rule” row (record) to portal metadata stored in the environment’s Dataverse.

Web Page Access Control Rule

You will still need to assign a portal user (contact) to the associated web role in order to view the page. My blog about hiding and showing portal content from a few years explains this process.

Hiding or Showing on the Main Menu?

By default, once you apply permissions to a web page, it will remove any evidence of that page from anyone not authorized to see it. In many cases, this is what you want.

Disappeared from Default Menu

However, there might be times where you do want to see the item on the main menu (so portal visitors knows that it exists).

There is a fairly unknown setting to accomplish this.

In the Portal Management app, navigate to Web Link Sets and pick the web link set that contains the menu item (in most cases, this is the “default” menu item). In the Links tab, locate the particular link to the page that you applied permissions to.

Web Link Sets

Open the Link record, scroll down and to find the “Disable Page Validate” checkbox and check it and save the record.

Clear the Cache (Always) and navigate back to the portal, you will now see the link to the page that is protected by permissions.

Link to protected page

What will happen when the user clicks the link? If they haven’t yet logged into the portal, they will be prompted to login. If their portal login (contact) is associated with the roles allowed to see the page, then they will see the page!

Login to view page

If the portal login (contact) is NOT associated to a role that has permissions to the page, they will see an “Access Denied” message.

Access Denied

Summary

The ability to set permissions to a Power Apps portal page is a nice addition to the Portal studio. However, at this time there is still no escaping the Portal Management app to set up some supporting data as well as fine tuning some aspects such as visibility of the portal menus.

Thanks to Sayyed Abbas for the question that inspired this post.

Video version of this post here: https://www.youtube.com/watch?v=dQ51YjqVp-g&t=1s

Cover Photo by seabass creatives on Unsplash

Nick Doelman is a Power Platform specialist, content creator, Microsoft Most Valuable Professional (MVP), and a Microsoft Certified Trainer (MCT). Nick will be speaking at Scottish Summit 2021 on the topic “More Power to Power Apps Portals” Follow Nick on twitter @ReadyXRM and check out Nick’s online training courses at 365.Training

3 thoughts on “Power Apps Portals – How to Show the Menu Link for a Restricted Page

  1. Hi Nick, I am trying to setup Web page Control access rules, and they are working fine unless… you need to clear the cache every time you assing or remove a web role to a contact. So, for example, i have Joe Doe contact. He sign in and he has no Web Roles associated, so he can’t navigate to my “protected page”. If I after a while add a web role, he still can’t access the page…. I waited up to 20 minutes but since I didn’t clear the portal cache it didn’t worked. Is this possible and acceptable? Web roles could change and is not an option to tell someone to be in front of the pc with an admininistrative role and clear the cache every time a contact changes the web roles…I suppose i am missing something, any help? Thank you very much in advance

    Like

Leave a reply to Nick Doelman Cancel reply