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_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
14 15 16 |
# File 'app/forms/decidim/admin/permission_form.rb', line 14 def (handler_name) find_handler(handler_name)&.dig("options") || {} end |
#authorization_handlers_names ⇒ Object
10 11 12 |
# File 'app/forms/decidim/admin/permission_form.rb', line 10 def .keys.map(&:to_s) end |
#manifest(handler_name) ⇒ Object
18 19 20 |
# File 'app/forms/decidim/admin/permission_form.rb', line 18 def manifest(handler_name) Decidim::Verifications.find_workflow_manifest(handler_name) end |
#options_attributes(handler_name) ⇒ Object
26 27 28 29 |
# File 'app/forms/decidim/admin/permission_form.rb', line 26 def (handler_name) manifest = (handler_name) manifest ? manifest.attributes : [] end |
#options_schema(handler_name) ⇒ Object
22 23 24 |
# File 'app/forms/decidim/admin/permission_form.rb', line 22 def (handler_name) (handler_name).schema.new((handler_name)) end |