Sha256: 9a9a9b5221d779532b8d9c64e46b76a880a6a9a07683ad4c03310087b67c49af

Contents?: true

Size: 1.3 KB

Versions: 13

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    module Admin
      # Controller that allows managing initiatives types
      # permissions in the admin panel.
      class InitiativesTypesPermissionsController < Decidim::Admin::ResourcePermissionsController
        include Decidim::TranslatableAttributes

        before_action :set_controller_breadcrumb
        add_breadcrumb_item_from_menu :admin_initiatives_menu

        layout "decidim/admin/initiatives"

        register_permissions(::Decidim::Initiatives::Admin::InitiativesTypesPermissionsController,
                             ::Decidim::Initiatives::Permissions,
                             ::Decidim::Admin::Permissions)

        def permission_class_chain
          ::Decidim.permissions_registry.chain_for(::Decidim::Initiatives::Admin::InitiativesTypesPermissionsController)
        end

        private

        def set_controller_breadcrumb
          controller_breadcrumb_items.append(
            {
              label: translated_attribute(resource.title),
              url: edit_initiatives_type_path(resource),
              active: false
            },
            {
              label: t("permissions", scope: "decidim.admin.actions"),
              active: true
            }
          )
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-initiatives-0.29.1 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.4 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.29.0 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.3 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.29.0.rc4 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.29.0.rc3 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.29.0.rc2 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.29.0.rc1 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.2 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.1 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.0 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.0.rc5 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb
decidim-initiatives-0.28.0.rc4 app/controllers/decidim/initiatives/admin/initiatives_types_permissions_controller.rb