Policy check returns HTTP status instead of JSON

Bug #1489669 reported by Thai Tran
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Medium
Thai Tran

Bug Description

Policy check today returns a JSON object containing an allowed flag that can either be true or false. This requires that we check the response object for the flag. It should instead just return a 204 for allowed, or a 406 for not allowed (401 is already taken for unauthorized - which redirects a user to the logout screen). This is undesirable since we may want to hide content but not kick the user out.

We have future plans to batch policy checks and cache them, but for now, the plan is for check to do a singular policy check that expects a boolean. This is also more inline with the plans we have for hz-if-policies directive.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/217982

Changed in horizon:
assignee: nobody → Thai Tran (tqtran)
status: New → In Progress
Revision history for this message
Thai Tran (tqtran) wrote :

Since there doesn't seem to be an HTTP code for no, we are sort of misusing 406. It is better to just write a wrapper for this service, bug is no longer valid.

Changed in horizon:
status: In Progress → Invalid
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-3 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.