spree/spree — pull request #5346 by Serabe (2014-09-10 07:56:01+00:00)
Title: Add Spree::Admin::RootController for redirecting purposes.

__Note__ I don't see how to use the same PR against different branches, so this is the same as #5345 but for 2-3-stable.

Currently, is really difficult to redirect to a different tab when the
user has logged in if said users cannot at least :admin, :index
`Spree::Order`s.

This commit adds a controller that handles `/admin` route so anyone can
easily redirect to another page (or implement any other logic).

## Why

As seen in [Spree Guides > Advanced Topics > Security > Custom Roles in the Admin Namespace](http://guides.spreecommerce.com/developer/security.html#custom-roles-in-the-admin-namespace), one can createa new role that has partial access to the admin panel. Sadly, if the new role has not access at all to `Spree::Order`s, then it will get an authorization failure. This cannot be done using `after_signin_path_for` from Devise since somehow `authorize_admin` is being called both before it and after it, so the redirection done is the one caused by the `authorize!` failing.

This PR aims to provide a simple way to produce such redirections. Currently has been tested on master (commit 620b640e9e) and 2-3-stable (commit a733136a1e98). I'm willing to try them in before version (down to 2-0-stable), but running `build.sh` takes over 30 minutes so I will do it just if you are interested on it.