Sha256: 6b500238ade5ad297e448051e9ddbbe22635e7fe42403ffe8ce230a574397f19
Contents?: true
Size: 969 Bytes
Versions: 11
Compression:
Stored size: 969 Bytes
Contents
module Spree module Admin class RootController < Spree::Admin::BaseController skip_before_filter :authorize_admin def index redirect_to admin_root_redirect_path end protected def admin_root_redirect_path if can?(:display, Spree::Order) && can?(:admin, Spree::Order) spree.admin_orders_path elsif can?(:admin, :dashboards) && can?(:home, :dashboards) spree.home_admin_dashboards_path else # Invoke the unauthorized redirect, which will ideally go to the login controller # of the users chosen authorization implimentation. For devise this is /admin/login. # # This is done so devise redirects back to this controller, instead of the one specified # below, so this controller can use the user that is required for the path to # be calculated. raise CanCan::AccessDenied end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems