Sha256: 91c47c6d72455ff8c770b2a29841ef9ef3611bba858f0926f66744ba6ae17e55

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 Bytes

Contents

module Brightcontent
  class ApplicationController < ActionController::Base
    before_filter :authorize

    private

    def current_user
      @current_user ||= AdminUser.find(session[:brightcontent_user_id]) if session[:brightcontent_user_id]
    end
    helper_method :current_user

    def user_resources
      @user_resources ||= RoutesParser.new.resources
    end
    helper_method :user_resources

    def authorize
      redirect_to login_url if current_user.nil?
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
brightcontent-core-2.0.33 app/controllers/brightcontent/application_controller.rb
brightcontent-core-2.0.31 app/controllers/brightcontent/application_controller.rb