Module: EngineRoom::ControllerMethods

Defined in:
lib/engine_room/action_controller/controller_methods.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
# File 'lib/engine_room/action_controller/controller_methods.rb', line 3

def self.included(base)
  base.module_eval do
    helper_attr :current_user
  end
end

Instance Method Details

#authorizeObject



13
14
15
16
17
18
# File 'lib/engine_room/action_controller/controller_methods.rb', line 13

def authorize
  unless current_er_devise_user.is_admin?
    flash[:alert] = "Access denied"
    redirect_to engine_room_root_url
  end
end

#current_userObject



9
10
11
# File 'lib/engine_room/action_controller/controller_methods.rb', line 9

def current_user
  current_er_devise_user
end