Sha256: 06d3f89a9864a0f7f6bb91f5274d35f128f68e4064e3e1976d49b8fa9c80506f

Contents?: true

Size: 922 Bytes

Versions: 5

Compression:

Stored size: 922 Bytes

Contents

module Itsf::Backend
  class HomeController < Configuration.home_base_controller.constantize
    helper Itsf::Backend::ApplicationHelper
    helper Itsf::Backend::BootstrapHelper
    helper MultiClientHelper if Itsf::Backend.features?(:multi_client)
    include Controller::CurrentEngineConcern
    include Controller::BreadcrumbsConcern

    def index
    end

    if Itsf::Backend.features?(:pundit)
      include Pundit
      prepend Controller::PunditNamespacedAuthorizeConcern
      include Controller::PunditAuthorizationFailureHandlingConcern
      helper_method :engine_policy

      after_action :verify_authorized

      def index
        authorize :engine, :access?, self.class.name.deconstantize
      end
    end

    layout 'itsf/backend/base'

    helper_method :engine

    def self.engine
      "#{name.deconstantize}::Engine".constantize
    end

    def engine
      self.class.engine
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
itsf_backend-5.0.0.pre app/controllers/itsf/backend/home_controller.rb
itsf_backend-4.2.3 app/controllers/itsf/backend/home_controller.rb
itsf_backend-4.2.2 app/controllers/itsf/backend/home_controller.rb
itsf_backend-4.2.1 app/controllers/itsf/backend/home_controller.rb
itsf_backend-4.2.0 app/controllers/itsf/backend/home_controller.rb