Packages

A resource declaration and interaction library. Built with pluggable data layers, and designed to be used by multiple front ends.

Retired package: Renamed - renamed to ash

Current section

Files

Jump to
ash_core lib ash error forbidden.ex
Raw

lib/ash/error/forbidden.ex

defmodule Ash.Error.Forbidden do
@moduledoc "Used when authorization for an action fails"
use Ash.Error
def_ash_error([:errors], class: :forbidden)
defimpl Ash.ErrorKind do
def id(_), do: Ecto.UUID.generate()
def message(%{errors: errors}) when not is_nil(errors) do
Ash.Error.error_messages(errors)
end
def message(%{errors: errors}) do
Ash.Error.error_descriptions(errors)
end
def code(_), do: "Forbidden"
end
end