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.26.10 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.9 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.8 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.7 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.5 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.4 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.3 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.0 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.0.rc2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.26.0.rc1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.0 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.0.rc4 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.0.rc3 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.0.rc2 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.25.0.rc1 app/forms/decidim/admin/permissions_form.rb
decidim-admin-0.24.3 app/forms/decidim/admin/permissions_form.rb