WSGI enfore fails should return 403 instead of 500
When user is not authorized to perform operations defined in policy
file, it should return a 403 error. The 500 error is incorrect.
This patch do the following changes:
1. Raise a PolicyNotAuthorized 403 exception when normal user
without admin privilege run command 'magnum service-list'.
2. Remove unnecessary hacking rule M301 'decorator must be
the first decorator on a method'.
3. Fix failed enforcement test cases introduced by 403
PolicyNotAuthorized exception.
Reviewed: https:/ /review. openstack. org/263219 /git.openstack. org/cgit/ openstack/ magnum/ commit/ ?id=7b754ae3908 7bc1b2cc5958ea1 0594b88436aec3
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7b754ae39087bc1 b2cc5958ea10594 b88436aec3
Author: houming-wang <email address hidden>
Date: Mon Jan 4 02:51:54 2016 -0500
WSGI enfore fails should return 403 instead of 500
When user is not authorized to perform operations defined in policy thorized exception.
file, it should return a 403 error. The 500 error is incorrect.
This patch do the following changes:
1. Raise a PolicyNotAuthorized 403 exception when normal user
without admin privilege run command 'magnum service-list'.
2. Remove unnecessary hacking rule M301 'decorator must be
the first decorator on a method'.
3. Fix failed enforcement test cases introduced by 403
PolicyNotAu
Change-Id: Ie5a7d138cdb8b2 26686c189ae86f2 51c0a1329c8
Closes-Bug: #1520311