AshCredo.Check.Warning.AuthorizerWithoutPolicies (ash_credo v0.5.2)

Copy Markdown View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of high and works with any version of Elixir.

Explanation

Resources that declare Ash.Policy.Authorizer but define no policies will deny all actions by default. An empty policies block has the same effect. This is almost always unintentional.

Either add policies:

policies do
  policy action_type(:read) do
    authorize_if actor_attribute_equals(:active, true)
  end
end

Or remove the authorizer if authorization is not needed yet.

Check-Specific Parameters

There are no specific parameters for this check.

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.