Before this patch, if user's rights were changed
or revoked - there would be "Unauthorized" errors
on every page since user had no rights to view them
because he had no valid tokens in that case.
Now user will be logged out if he has no valid tokens.
Set `escalate` to True (for unauthorized-error)
to always log user out.
Also, now horizon.exceptions.NotAuthorized is a part of
UNAUTHORIZED tuple in the exceptions.py, because this type
of exception is re-raised after handling services unauthorized errors.
Looks like it was missing. Now the horizon.exceptions.NotAuthorized
is handled like all NotAuthorized exceptions.
And horizon_middleware.py in process_exception now generates
logout_reason for cases if user is not authorized.
Reviewed: https:/ /review. openstack. org/142481 /git.openstack. org/cgit/ openstack/ horizon/ commit/ ?id=878c703fd00 6569219d3fc5be4 59f6ab76a48a15
Committed: https:/
Submitter: Jenkins
Branch: master
commit 878c703fd006569 219d3fc5be459f6 ab76a48a15
Author: Vlad Okhrimenko <email address hidden>
Date: Wed Dec 17 16:47:16 2014 +0200
Logout user if he has no valid tokens
Before this patch, if user's rights were changed
or revoked - there would be "Unauthorized" errors
on every page since user had no rights to view them
because he had no valid tokens in that case.
Now user will be logged out if he has no valid tokens.
Set `escalate` to True (for unauthorized-error)
to always log user out.
Also, now horizon. exceptions. NotAuthorized is a part of exceptions. NotAuthorized
UNAUTHORIZED tuple in the exceptions.py, because this type
of exception is re-raised after handling services unauthorized errors.
Looks like it was missing. Now the horizon.
is handled like all NotAuthorized exceptions.
And horizon_ middleware. py in process_exception now generates
logout_reason for cases if user is not authorized.
Closes-Bug: #1252341 0569c2f442fc87c bd58745757e
Closes-Bug: #1407105
Co-Authored-By: Paul Karikh <email address hidden>
Change-Id: I417cad936ea80c