# permit_phoenix v0.5.0 - Table of Contents

Phoenix, Plug and LiveView integrations for the Permit authorization library.

## Modules

- [Permit.Phoenix](Permit.Phoenix.md): Phoenix, Plug and LiveView integrations integration for [Permit](https://github.com/curiosum-dev/permit).

- Controllers
  - [Permit.Phoenix.Controller](Permit.Phoenix.Controller.md): Configures and injects the authorization plug for Phoenix controllers.

- LiveView
  - [Permit.Phoenix.LiveView](Permit.Phoenix.LiveView.md): Using this module, Permit authorization can be integrated with Phoenix LiveView at three key points:
1. During mount (via the `on_mount: Permit.Phoenix.LiveView.AuthorizeHook` hook)
2. During live navigation (via the `handle_params/3` callback)
3. During events (via the `handle_event/3` callback)
  - [Permit.Phoenix.LiveView.AuthorizeHook](Permit.Phoenix.LiveView.AuthorizeHook.md): Hooks into the :mount and :handle_params lifecycles to authorize the current action.
The current action is denoted by the :live_action assign (retrieved from the router),
for example with the following route definition

- Configuring actions
  - [Permit.Phoenix.Actions](Permit.Phoenix.Actions.md): Defines action names for your permissions schema, so that convenience functions
are generated for them.

- Types and errors
  - [Permit.Phoenix.RecordNotFoundError](Permit.Phoenix.RecordNotFoundError.md)
  - [Permit.Phoenix.Types](Permit.Phoenix.Types.md): Defines types for usage with Permit in the context of Phoenix applications.

## Mix Tasks

- [mix permit.patch.controller](Mix.Tasks.Permit.Patch.Controller.md): Patches an existing Phoenix controller to use Permit authorization.
- [mix permit.patch.live_view](Mix.Tasks.Permit.Patch.LiveView.md): Patches an existing Phoenix LiveView to use Permit authorization by adding
a `resource_module/0` callback and `@permit_action` annotations on `handle_event/3`
clauses with recognized event names.
- [mix permit_phoenix.install](Mix.Tasks.PermitPhoenix.Install.md): Installs Permit.Phoenix authorization into your project, creating an actions module
and patching the web module to include LiveView authorization.

