Restrict table access by Contact in Power Pages

In Power Pages, controlling which records a logged in portal user (contact) can access is essential for secure and personalised experiences. This post describes how one contact record can be associated to multiple provider records (Figure 1) and vice versa. Meaning, the contact will only have access to the provider records that they has been associated to. This example will describe how a logged in portal user (contact) will be setup to only be able to access providers A & C. To achieve this, the following steps will be followed

  1. Create the N:N relationship table
  2. Populate the relationship table
  3. Define table permissions
  4. Confirm Contact level filtering
Figure 1

Walkthrough

Step 1: Create the N:N relationship table

Start by creating an N:N table between the Contact and Provider tables. This enables multiple contacts to be linked to multiple providers

Figure 2: Provider – Contact relationship table

Step 2: Populate the relationship table

Next, populate the relationship table with records that define which contacts should have access to which providers

Figure 3: Relationship records which link Contact and Provider records

Step 3: Define table permissions

To enforce access control, configure a table permission on the Provider Contact table with Access Type = Contact. This ensures the logged in portal user (contact) will only be able to view providers which they have been associated to

Figure 4: Table permission: ProviderContact-Read

Create a child permission on the provider table permission (Figure 5) so that power pages knows which providers to display in the list (Figure 6)

Figure 5: Table permission: Provider-Read

Step 4: Confirm Contact level filtering

With table permissions in place, the logged in portal user (contact) e.g. Dustin will only see provider records they’re associated to.

Figure 6: Filtered Provider view based on the logged in user (Contact)

Summary

By leveraging N:N relationships and contact-level table permissions, it’s possible to precisely control record visibility in Power Pages. This approach enhances data security while delivering tailored user experiences

References

https://learn.microsoft.com/en-us/power-pages/security/table-permissions