Introduction
WPO365 Audiences can be configured at the following two levels:
- Page Level | Authors At page level, anyone who is allowed to edit the page can update the WPO365 Audiences configuration using the practical WordPress meta box.
- Global Level | Administrators Administrators are able configure post type based rules that will globally restrict access to content.
Page Level | Authors
Perform the following steps to apply WPO365 Audiences based restriction to a page as an author.
- Create a new post or page or start editing an existing one.
- Locate the practical WPO365 Audiences meta box in the page’s sidebar.
- From the list of WPO365 Audiences, select the ones that should be able to view the page in question.
Please make sure that you have excluded the author’s role from WPO365 Audiences, or else the author will not be able to view or edit the page after it has been saved with one or more WPO365 Audiences selected, and the author is not assigned to any of those.
Global Level | Administrators
Perform the following steps to apply WPO365 Audiences based restriction to a page as an administrator.
- Go to WP Admin > WPO365 > User Registration and scroll down to the Audiences section.
- Locate the setting Audience based restrictions for post types and select the post type for which you globally require a specific WPO365 Audience.
- Click “+” to add the restriction rule.
- When you finished the configuration, scroll to the bottom of the page and click Save configuration.
Testing restricted access
Perform the following steps to test restricted access using WPO365 Audiences.
- Copy the URL of a page for which you have enabled one or more WPO365 Audiences.
- Start a new browser session e.g. as guest or using an incognito browser and paste the URL of page in question in the address bar.
- Verify that you are sent to Microsoft to sign in.
- After you successfully authenticated, WPO365 should automatically redirect you to the URL that you intended to go initially.
- Verify that you can view the page, as expected.
- Now repeat the same test but with a user that is not assigned to any of the permitted WPO365 Audiences.
- Verify that you cannot view the page. Instead, you should receive a 404 Not Found error.