Sha256: 1b293b8734a65abc9ff67cdd5959f77202cecb41bedec46bf22d08170d40b876

Contents?: true

Size: 764 Bytes

Versions: 6

Compression:

Stored size: 764 Bytes

Contents

module Cms
  class BaseController < Cms::ApplicationController

    before_filter :redirect_to_cms_site
    before_action :authenticate_cms_user!
    before_filter :cms_access_required

    layout 'cms/application'


    # Disables the default security level for actions, meaning they will be available for guests to access.
    # Users will not need to login prior to accessing these methods.
    #
    # @param [Array<Symbol>] methods List of methods to disable security for.
    def self.allow_guests_to(methods)
      return true unless Cms.allow_guests?
      skip_before_action :redirect_to_cms_site, only: methods
      skip_before_action :authenticate_cms_user!, only: methods
      skip_before_action :cms_access_required, only: methods
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
browsercms-artirix-4.0.4 app/controllers/cms/base_controller.rb
browsercms-artirix-4.0.3.3 app/controllers/cms/base_controller.rb
browsercms-artirix-4.0.3.2 app/controllers/cms/base_controller.rb
browsercms-artirix-4.0.3.1 app/controllers/cms/base_controller.rb
browsercms-artirix-4.0.3 app/controllers/cms/base_controller.rb
browsercms-artirix-4.0.2 app/controllers/cms/base_controller.rb