Developers · Users and Permissions
Handling an Authorization Policy Violation
Last updated 1 November 2026
This document discusses how to handle a violated Authorization Policy.
When an Authorization Policy is violated, the server, by default, will return the head
Prerequisites
To follow the steps in this tutorial, it is essential to have a deep understanding of the concept of Permissions. The guidelines presented here rely on the Authorization Policy created in an earlier tutorial.
Steps
Handling a violated Authorization Policy is a two-step process:
- Step 1: Define a redirect or 403/404 page
- Step 2: Display the alert message
Step 1: Define a redirect or 403/404 page
Define whether you want to redirect the user to another page or display one of the 403 or 404 pages. To redirect the user to a page after violation, set the
---
name: only_allowed_by_johns
redirect_to: /login
---
...If, instead, you would like to render a customized 404 page, set the
---
name: only_allowed_by_johns
http_status: 404
redirect_to: ""
---
...The default behavior is equivalent to setting
Step 2: Display the alert message
To generate a flash alert message, use the
---
name: only_allowed_by_johns
redirect_to: /login
flash_alert: Please log in to access this page.
---
...As with all flash messages, you can access it in Liquid using the