LetMe.UnauthorizedError exception (LetMe v2.0.0)

Copy Markdown View Source

Raised by LetMe.Policy.authorize!/4 if a request is unauthorized.

Summary

Types

t()

Struct returned or raised if an authorization check fails.

Types

t()

@type t() :: %LetMe.UnauthorizedError{
  __exception__: true,
  expression: LetMe.expression() | nil,
  message: String.t()
}

Struct returned or raised if an authorization check fails.

expression and deny_checks contains the parts of the policy expression that were performed and their results. Checks are evaluated lazily, and deny checks are always evaluated first.

The expression reflects the checks until a decision is made, but it does not reflect the complete authorization policy.

Functions

new(message \\ "unauthorized")

@spec new(String.t()) :: t()