feat: add join request resource
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2a04fad4fe
commit
2515a679b8
9 changed files with 323 additions and 5 deletions
17
lib/mv/authorization/checks/actor_is_nil.ex
Normal file
17
lib/mv/authorization/checks/actor_is_nil.ex
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue