Module: Bouncer::ControllerMixin
- Defined in:
- lib/bouncer-client/controller_mixin.rb
Instance Method Summary collapse
- #authenticate_activation! ⇒ Object
- #authenticate_super_admin! ⇒ Object
- #authenticate_token! ⇒ Object
- #authenticate_user! ⇒ Object
- #current_user ⇒ Object
Instance Method Details
#authenticate_activation! ⇒ Object
20 21 22 23 |
# File 'lib/bouncer-client/controller_mixin.rb', line 20 def authenticate_activation! authenticate_token! raise UnauthorizedError unless current_user.activation? end |
#authenticate_super_admin! ⇒ Object
15 16 17 18 |
# File 'lib/bouncer-client/controller_mixin.rb', line 15 def authenticate_super_admin! authenticate_user! raise UnauthorizedError unless current_user.user.super_admin? end |
#authenticate_token! ⇒ Object
10 11 12 13 |
# File 'lib/bouncer-client/controller_mixin.rb', line 10 def authenticate_token! raise UnauthenticatedError unless Bouncer::Token.present? request raise UnauthenticatedError unless current_user.valid? end |
#authenticate_user! ⇒ Object
25 26 27 28 |
# File 'lib/bouncer-client/controller_mixin.rb', line 25 def authenticate_user! authenticate_token! raise UnauthorizedError unless current_user.user? end |