Permalink
Browse files

Merge "Return 403 instead of 401 when policies reject" into milestone…

…-proposed
  • Loading branch information...
2 parents 32a6f49 + 6fdd1f6 commit facd8951f7ca4e3dd613d70aba855d6800d89922 Jenkins committed with openstack-gerrit Jan 26, 2012
@@ -573,7 +573,7 @@ def __exit__(self, ex_type, ex_value, ex_traceback):
if isinstance(ex_value, exception.NotAuthorized):
msg = unicode(ex_value)
- raise Fault(webob.exc.HTTPUnauthorized(explanation=msg))
+ raise Fault(webob.exc.HTTPForbidden(explanation=msg))
elif isinstance(ex_value, TypeError):
LOG.exception(ex_value)
raise Fault(webob.exc.HTTPBadRequest())
@@ -174,7 +174,7 @@ def test_verify_show_cant_view_other_tenant(self):
try:
res = req.get_response(fakes.wsgi_app(
fake_auth_context=self.alt_user_context))
- self.assertEqual(res.status_int, 401)
+ self.assertEqual(res.status_int, 403)
finally:
policy.reset()
@@ -204,7 +204,7 @@ def index(self, req):
req = webob.Request.blank('/tests')
app = fakes.TestRouter(Controller())
response = req.get_response(app)
- self.assertEqual(response.status_int, 401)
+ self.assertEqual(response.status_int, 403)
def test_dispatch(self):
class Controller(object):

0 comments on commit facd895

Please sign in to comment.