Method: Puffer::Controller::Auth#current_puffer_user
- Defined in:
- lib/puffer/controller/auth.rb
#current_puffer_user ⇒ Object
Return current user instance, used for authorization. This method can be redefined in ApplicationController if you want to use application’s auth system.
ex:
class ApplicationController < ActionController::Base
def current_puffer_user
current_user
end
end
In this case returner user model instance should respond to has_role? method, or you should properly redefine has_puffer_access? See has_puffer_access? source and docs.
35 36 37 38 39 40 41 |
# File 'lib/puffer/controller/auth.rb', line 35 def current_puffer_user @current_puffer_user ||= begin super rescue NoMethodError ::Admin::SessionsController.model.to_adapter.get(session[:puffer_user_id]) end end |