Sha256: c0afe608430295d4396f5729c9e9b7560c032c5028e3181878d64f3715569bc7

Contents?: true

Size: 894 Bytes

Versions: 13

Compression:

Stored size: 894 Bytes

Contents

module CurationConcerns
  module AdminControllerBehavior
    extend ActiveSupport::Concern

    included do
      include AdminPage
      before_action :require_permissions
    end

    def index
      @resource_statistics = @configuration.fetch(:data_sources).fetch(:resource_stats).new
      render 'index'
    end

    def search_builder
      @search_builder ||= ::CatalogController.new.search_builder
    end

    def repository
      @repository ||= ::CatalogController.new.repository
    end

    def workflow
      @status_list = CurationConcerns::Workflow::StatusListService.new(current_user)
    end

    private

      def require_permissions
        authorize! :read, :admin_dashboard
      end

      # Loads the index action if it's only defined in the configuration.
      def action_missing(action)
        index if @configuration[:actions].include?(action)
      end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.7 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-2.0.0 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-2.0.0.rc2 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.6 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.5 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.4 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.3 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.2 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-2.0.0.rc1 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.1 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.0 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb
curation_concerns-1.7.0.beta1 app/controllers/concerns/curation_concerns/admin_controller_behavior.rb