Class: Decidim::Admin::PermissionForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Admin::PermissionForm
- Defined in:
- app/forms/decidim/admin/permission_form.rb
Overview
This form handles permissions for a particular action in the admin panel.
Instance Method Summary collapse
- #authorization_handler_options(handler_name) ⇒ Object
- #authorization_handlers ⇒ Object
- #authorization_handlers_names ⇒ Object
- #manifest(handler_name) ⇒ Object
- #options_attributes(handler_name) ⇒ Object
- #options_schema(handler_name) ⇒ Object
Instance Method Details
#authorization_handler_options(handler_name) ⇒ Object
20 21 22 |
# File 'app/forms/decidim/admin/permission_form.rb', line 20 def (handler_name) &.dig(handler_name.to_s) || {} end |
#authorization_handlers ⇒ Object
10 11 12 13 14 |
# File 'app/forms/decidim/admin/permission_form.rb', line 10 def handlers = super || [] handlers.index_with { |name| { "options" => (name) } } end |
#authorization_handlers_names ⇒ Object
16 17 18 |
# File 'app/forms/decidim/admin/permission_form.rb', line 16 def .keys.map(&:to_s) end |
#manifest(handler_name) ⇒ Object
24 25 26 |
# File 'app/forms/decidim/admin/permission_form.rb', line 24 def manifest(handler_name) Decidim::Verifications.find_workflow_manifest(handler_name) end |
#options_attributes(handler_name) ⇒ Object
32 33 34 35 |
# File 'app/forms/decidim/admin/permission_form.rb', line 32 def (handler_name) manifest = (handler_name) manifest ? manifest.attributes : [] end |
#options_schema(handler_name) ⇒ Object
28 29 30 |
# File 'app/forms/decidim/admin/permission_form.rb', line 28 def (handler_name) (handler_name).schema.new((handler_name)) end |