forked from fixin.me/fixin.me
Add Users#disguise/#revert
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
helper_method :current_user_disguised?
|
||||
|
||||
before_action :authenticate_user!
|
||||
|
||||
class AccessForbidden < StandardError
|
||||
@@ -6,6 +8,10 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
protected
|
||||
|
||||
def current_user_disguised?
|
||||
session[:revert_to_id].present?
|
||||
end
|
||||
|
||||
def after_sign_in_path_for(scope)
|
||||
if current_user.at_least(:admin)
|
||||
users_path
|
||||
|
||||
Reference in New Issue
Block a user