An Ash policy check that authorizes if the current actor has an active billing subscription.
Can be used as a simple check without options, or with a :price option to require a specific tier.
Usage
policies do
# Authorize any active subscription
policy action(:generate_report) do
authorize_if AshBilling.Checks.Subscribed
end
# Authorize only users subscribed to a specific price/tier
policy action(:export_enterprise_data) do
authorize_if {AshBilling.Checks.Subscribed, price: "price_enterprise_annual"}
end
endOptions
:price- An optional price identifier to require.:domain- The Ash domain to use when lazy-loading subscriptions (defaults to the domain in context).
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.