Ash.Error.Forbidden.Policy exception (ash v3.4.71)

View Source

Raised when policy authorization for an action fails

Summary

Functions

Create an Elixir.Ash.Error.Forbidden.Policy without raising it.

Print a report of an authorization failure from authorization information.

Print a report of an authorization failure from a forbidden error

Functions

exception(args)

@spec exception(opts :: Keyword.t()) :: %Ash.Error.Forbidden.Policy{
  __exception__: true,
  action: term(),
  actor: term(),
  bread_crumbs: term(),
  changeset_doesnt_match_filter: term(),
  class: term(),
  context_description: term(),
  domain: term(),
  facts: term(),
  filter: term(),
  for_fields: term(),
  must_pass_strict_check?: term(),
  path: term(),
  policies: term(),
  policy_breakdown?: term(),
  resource: term(),
  scenarios: term(),
  solver_statement: term(),
  splode: term(),
  stacktrace: term(),
  subject: term(),
  vars: term()
}

Create an Elixir.Ash.Error.Forbidden.Policy without raising it.

Keys

  • :scenarios
  • :facts
  • :filter
  • :actor
  • :policy_breakdown?
  • :must_pass_strict_check?
  • :for_fields
  • :subject
  • :context_description
  • :policies
  • :resource
  • :solver_statement
  • :domain
  • :action
  • :changeset_doesnt_match_filter

get_breakdown(facts, filter, policies, opts \\ [])

Print a report of an authorization failure from authorization information.

Options:

  • :help_text?: Defaults to true. Displays help text at the top of the policy breakdown.
  • :success?: Defaults to false. Changes the messaging/graphics around to indicate successful policy authorization.
  • :must_pass_strict_check?: Defaults to false. Adds a message about this authorization requiring passing strict check.

report(forbidden)

Print a report of an authorization failure from a forbidden error

Options:

  • :help_text?: Defaults to true. Displays help text at the top of the policy breakdown.

report(error, opts \\ [])