Sha256: 2df94c3b85215515fcd1e09f35eff73664f2dcdfbf595723e57ae513e414edc8

Contents?: true

Size: 661 Bytes

Versions: 27

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # A form object used to impersonate managed users from the admin dashboard.
    #
    # This form will contain a dynamic attribute for the user authorization.
    # This authorization will be selected by the admin user if more than one exists.
    class ImpersonateManagedUserForm < Form
      def initialize(attributes)
        extend(Virtus.model)

        # Set the authorization dynamic attribute as a nested form class based on the handler name.
        attribute(:authorization, attributes.dig(:authorization, :handler_name).classify.constantize)

        super
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
decidim-admin-0.7.4 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.7.3 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.7.2 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.7.1 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.7.0 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.8 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.8 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.7 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.7 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.6 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.6 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.5 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.5 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.4 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.4 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.3 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.3 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.2 app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-0.6.2 decidim-admin/app/forms/decidim/admin/impersonate_managed_user_form.rb
decidim-admin-0.6.1 app/forms/decidim/admin/impersonate_managed_user_form.rb