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:
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;
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.
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.
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.
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.
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.
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!
If the portal login (contact) is NOT associated to a role that has permissions to the page, they will see an “Access Denied” message.
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
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