Sha256: fd30876c7b3e62cfcb10ed9e47aa34efe8b745769b9afa9786961d351a8ccd36

Contents?: true

Size: 621 Bytes

Versions: 37

Compression:

Stored size: 621 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This form handles a set of forms related to handling permissions
    # in the admin panel.
    class PermissionsForm < Form
      mimic :component_permissions

      attribute :permissions, Hash[String => PermissionForm]

      private

      # Overriding Rectify::Form#form_attributes_valid? to preserve errors from custom method validations.
      def form_attributes_valid?
        return false unless errors.empty? && permissions.each_value.map(&:errors).all?(&:empty?)

        super && permissions.values.all?(&:valid?)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
decidim-admin-0.23.6 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.24.2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.5 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.24.1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.24.0 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.24.0.rc2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.4 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.24.0.rc1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.3 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.1.rc1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.23.0 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.22.0 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.21.0 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.20.1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.20.0 app/forms/decidim/admin/permissions_form.rb