Sha256: 55dc4e2a18922a12ffd0d27bcb155583767fd45672db841d6d5caca14b7b149a
Contents?: true
Size: 1.14 KB
Versions: 7
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true module Decidim module Admin # This form handles permissions for a particular action in the admin panel. class PermissionForm < Form attribute :authorization_handlers, Hash attribute :authorization_handlers_options, Hash def authorization_handlers_names authorization_handlers.keys.map(&:to_s) end def authorization_handler_options(handler_name) find_handler(handler_name)[:options] end def manifest(handler_name) Decidim::Verifications.find_workflow_manifest(handler_name) end def options_schema(handler_name) options_manifest(handler_name).schema.new(find_handler(handler_name)["options"] || {}) end def options_attributes(handler_name) manifest = options_manifest(handler_name) manifest ? manifest.attributes : [] end private def options_manifest(handler_name) manifest(handler_name).options end def find_handler(handler_name) authorization_handlers[handler_name.to_s] || authorization_handlers[handler_name.to_sym] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems