tuskar-ui/horizon/test
Tihomir Trifonov 3e0f69da75 Show message when user has no permissions
Shows a warning messages to users who try to access
restricted page.

This bug can be simply fixed in middleware.py:

    if isinstance(exception, (exceptions.NotAuthorized,
                              exceptions.NotAuthenticated)):
        if request.user.is_authenticated() and 'next' in request.GET:
            # a logged-in users gets NotAuthorized exception,
            # then just redirect to user_home instead of '?next='

But in the case when an user uses different logins(e.g for
different projects), and wants to switch fast between them,
trying to load an admin-only(or other restricted) page,
then Dashboard will redirect them to their home page,
and the user will have to sign-out first, then login again
and load the desired page.

With this fix however, the user will see a message, giving them a choice
to login as different user, or to go to their 'home page' if
they landed on the restricted page by error, allowing fast-switching
between multiple accounts.
Also, this will work fine with bookmarked pages.

P.S. The html repr of the error message will
probably need some improvements...

Fixes bug 1053698

Change-Id: Id458af6c7bd90081fc95d339b32a3654878a927d
2012-10-14 12:33:09 +03:00
..
templates Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
test_dashboards Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
tests Show message when user has no permissions 2012-10-14 12:33:09 +03:00
__init__.py Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
helpers.py Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
settings.py Splits OpenStack Dashboard bits from framework app code. 2012-10-11 11:47:50 -07:00
urls.py Show message when user has no permissions 2012-10-14 12:33:09 +03:00