AshDispatch.PolicyChecks.HasPermission (AshDispatch v0.5.1)

View Source

Policy check that delegates to a configured permission checker.

This allows the consuming application to define how permissions are checked without ash_dispatch needing to know about the application's permission system.

Configuration

Set the permission checker module in your config:

config :ash_dispatch,
  permission_checker: MyApp.Accounts.PolicyHelpers.HasPermission

The permission checker module should implement the Ash.Policy.Check behaviour and accept a permission option.

Summary

Functions

eager_evaluate?()

Callback implementation for Ash.Policy.Check.eager_evaluate?/0.

prefer_expanded_description?()

Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.

requires_original_data?(_, _)

Callback implementation for Ash.Policy.Check.requires_original_data?/2.

strict_check(actor, context, opts)

Callback implementation for Ash.Policy.Check.strict_check/3.

type()

Callback implementation for Ash.Policy.Check.type/0.