PermitEx.Policy behaviour (permit_ex v0.1.0)

Copy Markdown View Source

Behaviour for optional resource-level policy checks.

RBAC answers whether a scope has a permission. A policy can answer whether that scope may use the permission against a specific resource.

Summary

Callbacks

authorize(scope, resource, opts)

@callback authorize(scope :: term(), resource :: term(), opts :: keyword()) ::
  :ok | true | false | {:error, term()}