Sha256: 4222e0945dd34c73ed245687acc2f0f4ddd867bbf71889b77442c577dec70e6b

Contents?: true

Size: 519 Bytes

Versions: 5

Compression:

Stored size: 519 Bytes

Contents

# encoding: utf-8

module ConstructorCore
  class ApplicationController < ApplicationController
    before_filter :authenticate_user!, :except => [:show]

    helper_method :current_user

    private

    def authenticate_user!
      warden.authenticate!
    end

    def user_signed_in?
      !!current_user
    end

    def current_user
      @current_user ||= warden.authenticate
    end

    def user_session
      current_user && warden.session
    end

    def warden
      request.env['warden']
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
constructor-core-0.5.8 app/controllers/constructor_core/application_controller.rb
constructor-cms-0.5.8 core/app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.7 app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.6 app/controllers/constructor_core/application_controller.rb
constructor-core-0.5.5 app/controllers/constructor_core/application_controller.rb