Sha256: 18f6ceffef3d867546b57aee01eac8f5e6626d8e6692b4f134a531d3b28c5345

Contents?: true

Size: 938 Bytes

Versions: 2

Compression:

Stored size: 938 Bytes

Contents

# frozen_string_literal: true
module Decidim
  module Admin
    # The main application controller that inherits from Rails.
    class ApplicationController < ActionController::Base
      include NeedsOrganization
      include NeedsAuthorization
      include FormFactory
      include LocaleSwitcher
      include PayloadInfo
      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

2 entries across 2 versions & 2 rubygems

Version Path
decidim-admin-0.0.6 app/controllers/decidim/admin/application_controller.rb
decidim-0.0.6 decidim-admin/app/controllers/decidim/admin/application_controller.rb