Adding ifAllowed method to policy

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

Bug Description

Policy current returns a response object containing the allowed field, which either is true or false. To simplify this a bit, we need a wrapper method ifAllowed that would return a promise that either resolves or rejects. If it resolves, the success handler is called, and if it rejects, the error handler is called. This is more useful in practice and negates the need to check the response object. Furthermore, this is useful for creating a hz-if-policies directive in the future.

Changed in horizon:
assignee: nobody → Thai Tran (tqtran)
status: New → In Progress
Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-3 → liberty-rc1
Changed in horizon:
milestone: liberty-rc1 → next
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/217982
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=75e3f9b9a892e7c562ed7e3d8a90f734297963a0
Submitter: Jenkins
Branch: master

commit 75e3f9b9a892e7c562ed7e3d8a90f734297963a0
Author: Thai Tran <email address hidden>
Date: Wed Sep 30 09:59:22 2015 -0700

    Adding ifAllowed method to policy service

    Policy current returns a response object containing the allowed field,
    which either is true or false. To simplify this a bit, we need a wrapper
    method ifAllowed that would return a promise that either resolves or
    rejects. If it resolves, the success handler is called, and if it rejects, the error
    handler is called.

    This is more useful in practice and negates the need to check the response
    object. Furthermore, this is useful for creating a hz-if-policies directive in
    the future. The user table controller is included in this patch to show how it
    can be use in practice.

    Change-Id: I58d088cfe2df001c9252697592ad03a217cdb30a
    Closes-Bug: #1491180

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 9.0.0.0b1

This issue was fixed in the openstack/horizon 9.0.0.0b1 development milestone.

Changed in horizon:
status: Fix Committed → Fix Released
Changed in horizon:
milestone: next → 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.