Sha256: f1564bdf7734bae66790af85c7d6e668ff0822391c883913ce89230d056651e7

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # The main application controller that inherits from Rails.
    class ApplicationController < ::DecidimController
      include NeedsOrganization
      include NeedsAuthorization
      include FormFactory
      include LocaleSwitcher
      include PayloadInfo
      helper Decidim::Admin::ApplicationHelper
      helper Decidim::Admin::AttributesDisplayHelper
      helper Decidim::Admin::FeatureSettingsHelper
      helper Decidim::Admin::ProcessGroupsForSelectHelper
      helper Decidim::Admin::ProcessesForSelectHelper
      helper Decidim::Admin::IconLinkHelper
      helper Decidim::Admin::MenuHelper
      helper Decidim::DecidimFormHelper
      helper Decidim::ReplaceButtonsHelper
      helper Decidim::OrganizationScopesHelper
      helper Decidim::TranslationsHelper
      helper Decidim::LanguageChooserHelper

      protect_from_forgery with: :exception, prepend: true

      def user_not_authorized_path
        decidim_admin.root_path
      end

      # Overwrites `cancancan`'s method to point to the correct ability class,
      # since the gem expects the ability class to be in the root namespace.
      def current_ability_klass
        Decidim::Admin::Abilities::Base
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
decidim-admin-0.3.2 app/controllers/decidim/admin/application_controller.rb
decidim-0.3.2 decidim-admin/app/controllers/decidim/admin/application_controller.rb
decidim-admin-0.3.1 app/controllers/decidim/admin/application_controller.rb
decidim-0.3.1 decidim-admin/app/controllers/decidim/admin/application_controller.rb
decidim-admin-0.3.0 app/controllers/decidim/admin/application_controller.rb
decidim-0.3.0 decidim-admin/app/controllers/decidim/admin/application_controller.rb