Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In the previous tutorial, you added a list to a page; however, users wouldn't be able to view any data. Power Pages has security enabled by default to protect your business data. This tutorial explains how to create table permissions and associate them with web roles so visitors to your site can only interact with the information you allow.
In this tutorial, you learn how to:
- Create table permissions
- Set access type and privileges
- Add web roles
Prerequisites
- A Power Pages subscription or trial. Get a Power Pages trial here.
- A Power Pages site created. Create a Power Pages site.
- Complete the Add and design a page tutorial.
- Complete the Add a list to a page tutorial.
Create table permissions
This video provides an overview of the steps to create table permissions.
To learn how to configure table permissions to view data:
Go to Power Pages.
In the pages workspace, on the page with a list component, select the component and choose the Permissions button.
Select New table permissions.
Give table permission a name.
Select a Dataverse table.
Set the access type to Global.
Warning
In this example, the goal is to make the list of all scholarship records accessible to anyone visiting your site, so using the global option is appropriate. However, in other situations, be cautious about the permissions you grant to tables. For example, if a site visitor is signed into your site and needs to view and update their contact information, use a different access type. Self access restricts users to only viewing and updating their own contact information.
Set the permissions to Read.
Choose Anonymous and Authorized user for the web roles.
Now that table permissions are set, view the page by selecting Preview.
You should now see a list of Dataverse records on the page.
Note
You can give the table permission any name, but ideally it should be descriptive.
Set access type and privileges
When you configure a list or a form in Power Pages, by default, users don't have access to the information in Dataverse. Sometimes, you might want to limit what data a particular set of users can access. You can do control access with a combination of table permissions and security roles.
If your table in Dataverse has a relationship with a Contact or Account table, you can filter the records based on that relationship.
In the following example, we created a table that has a lookup to the contact table.
This video provides an overview of the steps to set access types and privileges.
Create a page with a list showing records that have a relationship to the contact table.
Note
Go to Tutorial: Add list to a page for details on how to a list to page. Create a table with a lookup to the contact table.
From the list on the page, choose on the Permission button.
Select to create a new table permission.
Give the table permission a name and choose Table.
Select Access type Global access.
Set permissions to Read.
Assign the Table permission to the Authenticated user web role.
Select Save.
Preview the site and sign-in. For purposes of this tutorial, you can sign in using Microsoft Entra ID.
View the page on the site. When any user signs in, they should see all the data in the table.
In our example, we would only want to show records that related to the currently signed-in user. Return to the design studio, select the list on the page and select permissions.
Modify the existing table permission and change the Access Type to Contact Access.
You need to specify the relationship between your table and the contact table.
Note
If you don't see a relationship, you need to define a lookup to the contact table using the Data workspace. Create or update some records that are related to the contact record you're using to sign-in to the site.
Preview the site and sign-in. You now should only see records that are related to the contact that signed in to the site.
More information
There are several different access types and privileges in Power Pages.
For more information, see:
Add web roles
Create custom web roles to control which site visitors can access data and restricted pages. In this example, you create a Students web role, assign it to a contact, and associate it with an existing table permission.
Power Pages includes default web roles. Anonymous Users applies to visitors who aren't signed in, and Authenticated Users applies to everyone who signs in. The Administrators role provides access to manage site content.
This video provides an overview of using web roles.
Create a custom web role
Create the web role in the Power Pages Management app.
- In the Power Pages design studio, select the ellipsis (...) in the left navigation, and then select Power Pages Management. The app opens in a new tab.
- In the Power Pages Management app, under Security, select Web Roles.
- Select New.
- In Name, enter a descriptive name for the web role, such as Students.
- In Website, select your site.
- Leave Authenticated Users Role and Anonymous Users Role set to No.
- Select Save.
Assign the web role to a contact
The site stores users as contact records. Assign the custom web role to each contact who needs the access it provides.
- In the Power Pages Management app, under Security, select Contacts.
- Open the contact record for the site user.
- On the General tab, scroll to the Web Roles section, and then select Add Existing Web Role.
- In the Lookup Records pane, search for and select Students, and then select Add.
- Confirm that Students appears in the contact's Web Roles section.
Associate the web role with a table permission
Assign the custom web role to an existing table permission to give its members the access defined by that permission.
- Return to the Power Pages design studio.
- Select the Security workspace, and then select Table permissions.
- Open the table permission you want to associate with the web role. In the video example, the table permission is Feedback.
- On the Basic tab, under Roles, select Add roles.
- Select Students.
- Close the role selector, and then select Save.
Important
Adding a custom web role doesn't remove access granted to other web roles. To limit this table permission to members of Students, remove the other roles from this permission. Review other table permissions for the same table, because they might also grant access.
Note
If the new web role doesn't appear, select Sync in the design studio, refresh the browser page, and then reopen the table permission.
Next steps
Showing data in a list view to the correct audience is an important feature of Power Pages. The next tutorial will cover adding a form to a page to allow users to create and edit business data.