mitgliederverwaltung/lib/mv/authorization/checks/actor_is_nil.ex
Simon 2515a679b8
All checks were successful
continuous-integration/drone/push Build is passing
feat: add join request resource
2026-03-09 14:44:45 +01:00

17 lines
578 B
Elixir

defmodule Mv.Authorization.Checks.ActorIsNil do
@moduledoc """
Policy check: true only when the actor is nil (unauthenticated).
Used for the public join flow so that submit and confirm actions are allowed
only when called without an authenticated user (e.g. from the public /join form
and confirmation link). See docs/onboarding-join-concept.md.
"""
use Ash.Policy.SimpleCheck
@impl true
def describe(_opts), do: "actor is nil (unauthenticated)"
@impl true
def match?(nil, _context, _opts), do: true
def match?(_actor, _context, _opts), do: false
end