class Decidim::Verifications::WorkflowManifest
This class serves as a DSL to declaratively specify a verification method.
To define a direct verification method, you need to specify the `form` attribute as a `Rectify::Form` that will be valid if the authorization is valid.
To define a deferred verification method, you need specify the `engine` attribute as a full `Rails::Engine` (and optionally another engine for the admin side as the `admin_engine` attribute). The verification will succeed once the engine creates a valid authorization for the method with the `granted_at` column set in DB.
Note that whereas direct methods can be used for “on the fly” verification, deferred methods require the authorization status to be persisted into DB. That's the reason why only direct methods can be used for user impersonation, for example, since they require continuous “on the fly” verification by the impersonating user.
Public Instance Methods
# File lib/decidim/verifications/workflow_manifest.rb, line 60 def description "#{fullname} (#{I18n.t(type, scope: "decidim.authorization_handlers")})" end
# File lib/decidim/verifications/workflow_manifest.rb, line 46 def engine_or_form engine || form end
# File lib/decidim/verifications/workflow_manifest.rb, line 56 def fullname I18n.t("#{key}.name", scope: "decidim.authorization_handlers", default: name.humanize) end
Public: Adds configurable settings for this verification workflow. It uses the DSL specified under `Decidim::SettingsManifest`.
&block - The DSL present on `Decidim::SettingsManifest`
Examples:
workflow.options do |options| options.attribute :minimum_age, type: :integer, default: 18 end
Returns nothing.
# File lib/decidim/verifications/workflow_manifest.rb, line 84 def options @options ||= SettingsManifest.new yield(@options) if block_given? @options end
# File lib/decidim/verifications/workflow_manifest.rb, line 50 def type form ? "direct" : "multistep" end