Associating an Authorization Policy with a Page

Last edit:  Feb 11, 2019

Contributors:  pavelloz lemingos diana-lakatos

This guide will help you associate an Authorization Policy with a page.

Similarly to FormConfiguration (see Associating an Authorization Policy with Form Configuration, you can also associate a policy with a page.

Requirements

So that you can follow the steps in this tutorial, you should understand the concept of Authorization Policy, and you should have created a page and an Authorization Policy.

Steps

Associating an Authorization Policy with a page is a two-step process:

Step 1: Edit page configuration

Create a custom page that you only want users with the first name John to be able to access:

---
slug: john-private-page
---
<h1>Hello John!</h1>

Step 2: Add authorization_policies key to page configuration

Add the authorization_policies key to page configuration
and specify the Authorization Policy for the page:

---
slug: john-private-page
authorization_policies:
  - only_allowed_by_johns
---
<h1>Hello John!</h1>

Next steps

Congratulations! You know how to associate an Authorization Policy with a page. Now you can learn about handling violated Authorization Policies:

Questions?

We are always happy to help with any questions you may have. Check out our Help page, or contact us.