Policy check: passes unless the action would create a new account on a site that is offline.
Put it on the sign-up action, above the bypasses so that it is the first word:
policy action(:register_with_password) do
forbid_unless {MishkaCmsCore.Accounts.Checks.RegistrationOpen, []}
authorize_if always()
endSigning in is untouched. A site that is down still has to let its admin back in, so an account that already exists may authenticate by any means.
Which site
The changeset's tenant, which MishkaCmsCore.Runtime.Plugs.SiteLookupPlug sets from the request's
host. With no tenant the global switch alone decides, so a master who has taken every site offline
also closes registration for anything that reaches this without one.
Who may create an account with no tenant — a master — is asked by
MishkaCmsCore.Accounts.Validations.MasterUserCreation, on the action itself.
Summary
Functions
Callback implementation for Ash.Policy.Check.eager_evaluate?/0.
Callback implementation for Ash.Policy.Check.init/1.
Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.
Callback implementation for Ash.Policy.Check.requires_original_data?/2.
Callback implementation for Ash.Policy.Check.strict_check/3.
Callback implementation for Ash.Policy.Check.type/0.
Functions
Callback implementation for Ash.Policy.Check.eager_evaluate?/0.
Callback implementation for Ash.Policy.Check.init/1.
Callback implementation for Ash.Policy.Check.prefer_expanded_description?/0.
Callback implementation for Ash.Policy.Check.requires_original_data?/2.
Callback implementation for Ash.Policy.Check.strict_check/3.
Callback implementation for Ash.Policy.Check.type/0.