Module: Spree::Admin::BaseControllerDecorator

Defined in:
lib/controllers/backend/spree/admin/base_controller_decorator.rb

Instance Method Summary collapse

Instance Method Details

#unauthorizedObject

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 unauthorized
  if try_spree_current_user
    flash[:error] = Spree.t(:authorization_failure)
    redirect_to spree.admin_unauthorized_path
  else
    store_location
    redirect_to spree.
  end
end