August 2025
Intermediate to advanced
294 pages
6h 59m
English
Now that we have a bit of context around policies and how they can restrict access to actions, we can check out the policies that were automatically generated in the Tunez.Accounts.User resource when we installed AshAuthentication:
| | defmodule Tunez.Accounts.User do |
| | # ... |
| | policies do |
| | bypass AshAuthentication.Checks.AshAuthenticationInteraction do |
| | authorize_if always() |
| | end |
| | |
| | policy always() do |
| | forbid_if always() |
| | end |
| | end |
| | # ... |
| | end |
There are two policies defined in the resource: bypass (more on bypasses here) and standard. The AshAuthenticationInteraction module, used in the bypass, contains a custom policy condition that applies to ...
Read now
Unlock full access