Module: Spree::Admin::BaseControllerDecorator
- Defined in:
- lib/controllers/backend/spree/admin/base_controller_decorator.rb
Instance Method Summary collapse
-
#unauthorized ⇒ Object
Redirect as appropriate when an access request fails.
Instance Method Details
#unauthorized ⇒ Object
Redirect as appropriate when an access request fails. The default action is to redirect to the login screen. Override this method in your controllers if you want to have special behavior in case the user is not authorized to access the requested action. For example, a popup window might simply close itself.
5 6 7 8 9 10 11 12 13 |
# File 'lib/controllers/backend/spree/admin/base_controller_decorator.rb', line 5 def if try_spree_current_user flash[:error] = Spree.t(:authorization_failure) redirect_to spree. else store_location redirect_to spree.admin_login_path end end |