I have a boolean attribute 'boss' on my user model, how do I create a custom authenticate_user!
in my before_filter so that only users where user.boss == true
are authenticated?
Asked
Active
Viewed 1,807 times
1

Pardeep Dhingra
- 3,916
- 7
- 30
- 56

raphael_turtle
- 7,154
- 10
- 55
- 89
-
http://stackoverflow.com/questions/6425231/i-want-to-override-authenticate-user-and-current-user-method-of-devise-gem – Pardeep Dhingra May 28 '15 at 13:39
-
and for the requirement you are saying you should override session controller of devise gem instead authenticate_user! – Pardeep Dhingra May 28 '15 at 13:42
1 Answers
-2
before_filter do
redirect_to root_path unless current_user && current_user.boss?
end

raphael_turtle
- 7,154
- 10
- 55
- 89