Sha256: b97457f3882554a010b8dcba55dfa2f7464c56f19d9805b830107c81f7eab6a2

Contents?: true

Size: 947 Bytes

Versions: 2

Compression:

Stored size: 947 Bytes

Contents

# frozen_string_literal: true
module Decidim
  module Admin
    module Features
      # This controller is the abstract class from which all feature
      # controllers in their admin engines should inherit from.
      class BaseController < Admin::ApplicationController
        skip_authorize_resource
        include Concerns::ParticipatoryProcessAdmin
        include NeedsParticipatoryProcess
        helper_method :current_feature, :current_participatory_process, :parent_path

        before_action do
          authorize! :manage, current_feature
        end

        private

        def current_feature
          request.env["decidim.current_feature"]
        end

        def current_participatory_process
          request.env["decidim.current_participatory_process"]
        end

        def parent_path
          decidim_admin.participatory_process_features_path(current_participatory_process)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
decidim-admin-0.0.1 lib/decidim/admin/features/base_controller.rb
decidim-0.0.1 decidim-admin/lib/decidim/admin/features/base_controller.rb