Configuring Web Roles

Loading

Power Pages (formerly Power Apps Portals) allow you to build secure, role-based web applications that can serve internal and external users. One of the most crucial elements in building a secure Power Pages site is Web Roles, which control what users can view, edit, or access across the portal.

In this guide, we’ll explore Web Roles deeply — what they are, how to configure them, and how they can be used for securing content and functionality in your portal.


1. What Are Web Roles in Power Pages?

Web Roles are user access levels assigned within Power Pages. They allow you to:

  • Control page visibility and content access
  • Manage permissions to Dataverse data via Entity Permissions
  • Apply role-based logic using Liquid, CSS, and JavaScript
  • Enable or restrict access to authenticated features

There are two types of users in Power Pages:

  • Anonymous Users (not signed in)
  • Authenticated Users (signed in through Azure AD B2C, Microsoft Entra ID, or local authentication)

You can assign web roles to authenticated users to define what they can or cannot access.


2. Where Are Web Roles Managed?

Web Roles are configured using the Portals Management App. This app allows you to manage:

  • Web Roles
  • Web Page Access Control Rules
  • Table Permissions (Entity Permissions)
  • Content Access

To access:

  1. Go to https://make.powerapps.com
  2. Open Apps > Portals Management
  3. Navigate to Web Roles

3. Creating a Web Role – Step-by-Step

Step 1: Open the Portals Management App

  • Launch the app as mentioned above.
  • From the left pane, select Web Roles.
  • Click + New to create a new role.

Step 2: Fill Out Web Role Details

FieldDescription
NameA descriptive name like “Registered Users” or “Admin”
WebsiteSelect the appropriate Power Pages site
Authenticated Users RoleCheck this box if it should apply only to signed-in users
Anonymous Users RoleCheck this if it applies to users who haven’t signed in
DescriptionOptional, but useful for documentation

Once done, Save and Close.


4. Assigning Web Roles to Users

Web Roles are not assigned manually via a user profile, but rather through Contact records in Dataverse.

How to Assign:

  1. Go to the Contacts table in Power Apps or Portals Management.
  2. Open a contact record (the user).
  3. Under Web Roles, add the desired role(s).
  4. Save the record.

This applies the permissions and access controls defined in that Web Role to the user.


5. Use Cases for Web Roles

Use CaseWeb Role Configuration
Members-only contentCreate a “Members” role and secure specific pages
Admin dashboardCreate an “Admin” role with page access + full table permissions
Anonymous view onlyUse Anonymous Users Role to limit access to public pages only
Role-based navigationUse Liquid to display menus or links conditionally

6. Web Page Access Control with Web Roles

You can secure specific pages by associating them with Web Roles.

How:

  1. Go to Web Pages in the Portals Management App.
  2. Open a page to secure.
  3. Scroll to Access Control Rules.
  4. Add a new rule:
    • Type: Read (to allow viewing)
    • Web Role: Select the role allowed to view the page
    • Scope: Either the page itself or descendants too

Only users with that role can access the page.


7. Table (Entity) Permissions Using Web Roles

Web Roles are also tied to Table Permissions (previously known as Entity Permissions), which allow users to interact with Dataverse tables securely.

Example:

To allow “Registered Users” to submit a contact form:

  1. Create a Web Role called “Registered Users”
  2. Create a Table Permission with:
    • Table Name: Contact
    • Scope: Self
    • Permissions: Create, Read, Update
    • Assign the Web Role
  3. Publish the permission

Now, users with that role can submit and manage their contact data.


8. Role-Based Logic in Liquid Templates

Liquid templates allow you to conditionally show/hide content based on Web Roles:

Example 1 – Show content only to Admins:

{% if user.roles contains 'Admin' %}
<a href="/admin-dashboard">Admin Dashboard</a>
{% endif %}

Example 2 – Hide download link from non-members:

{% unless user.roles contains 'Members' %}
<p>This content is for members only.</p>
{% endunless %}

9. Managing Anonymous and Authenticated Users

User TypeWeb Role Usage
AnonymousAssign roles for public viewing, restrict submission forms
AuthenticatedAssign roles post-login to unlock protected content or features

You can configure roles that apply automatically upon login, especially useful for public users who register.


10. Using Multiple Web Roles

A user can have multiple Web Roles assigned. For example:

  • A user can be both Editor and Contributor
  • You can layer permissions by assigning multiple roles to one contact

Make sure the permissions across these roles don’t conflict.


11. Testing Web Roles

To test:

  1. Sign in using a test account.
  2. Ensure it’s linked to a contact with the correct web roles.
  3. Try accessing secured pages or features.
  4. Use incognito mode to test anonymous access.

Tip: Build different test users for each major role and switch between them during testing.


12. Best Practices

Best PracticeDescription
Use meaningful names“Admin”, “Author”, “Support Agent” instead of “Role1”
Keep it minimalDon’t overload users with too many roles
Secure sensitive pagesAlways test that restricted pages are not accessible without roles
Use role-based redirectsSend users to appropriate dashboards upon login
Combine with Table PermissionsFor full data security, always pair Web Roles with Table (Entity) Permissions

13. Common Issues and Fixes

IssueCauseFix
Page shows “Access Denied”Web Role not assigned or missing access ruleVerify user’s Contact record and Access Control Rules
Data not savingTable Permission missingCreate appropriate Table Permission and link Web Role
Navigation links showing to everyoneRole check missing in LiquidUse user.roles contains logic in Liquid
Authenticated user can’t log inContact record not created or syncedVerify contact creation and authentication provider configuration

Leave a Reply

Your email address will not be published. Required fields are marked *