)]}'
{"openstack_dashboard/static/app/core/cloud-services/hz-if-policies.directive.js":[{"author":{"_account_id":9622,"name":"Cindy Lu","email":"clu@us.ibm.com","username":"clu14"},"change_message_id":"7e483ab3719c6dd501ee383f6d2e7b6d96727f1f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"  /**"},{"line_number":30,"context_line":"   * @ngdoc directive"},{"line_number":31,"context_line":"   * @name hz.api:directive:hzIfPolicies"},{"line_number":32,"context_line":"   * @module hz.api"},{"line_number":33,"context_line":"   *"},{"line_number":34,"context_line":"   * @description"},{"line_number":35,"context_line":"   * Add this directive to any element containing content which should only be"}],"source_content_type":"text/javascript","patch_set":5,"id":"9a1a9d01_e9aeb780","line":32,"updated":"2015-10-01 17:07:37.000000000","message":"paths for @name and @module are wrong.\n\nShould be:\n\n@name horizon.app.core.cloud-services:directive:hzIfPolicies\n\n@module horizon.app.core.cloud-services","commit_id":"ae1d5d9f86b1ab672dc504158f4bfbc2d50912d3"},{"author":{"_account_id":9622,"name":"Cindy Lu","email":"clu@us.ibm.com","username":"clu14"},"change_message_id":"7e483ab3719c6dd501ee383f6d2e7b6d96727f1f","unresolved":false,"context_lines":[{"line_number":50,"context_line":"   *"},{"line_number":51,"context_line":"   * Then in your HTML, use it like so:"},{"line_number":52,"context_line":"   ```html"},{"line_number":53,"context_line":"    \u003cdiv hz-policy-toggle\u003d\u0027ctrl.policy\u0027\u003e"},{"line_number":54,"context_line":"      \u003cspan\u003eI am visible if the policy is allowed!\u003c/span\u003e"},{"line_number":55,"context_line":"    \u003c/div\u003e"},{"line_number":56,"context_line":"   ```"}],"source_content_type":"text/javascript","patch_set":5,"id":"9a1a9d01_8553616c","line":53,"updated":"2015-10-01 17:07:37.000000000","message":"hz-if-policies?","commit_id":"ae1d5d9f86b1ab672dc504158f4bfbc2d50912d3"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"6e5b462388440f96cdcbb6ddc4e40d9372d35bcf","unresolved":false,"context_lines":[{"line_number":57,"context_line":"   */"},{"line_number":58,"context_line":"  function hzIfPolicies(hzPromiseToggle, policy) {"},{"line_number":59,"context_line":"    return angular.extend(hzPromiseToggle[0], {"},{"line_number":60,"context_line":"      singlePromiseResolver: policy.check,"},{"line_number":61,"context_line":"      name: \u0027hzIfPolicies\u0027"},{"line_number":62,"context_line":"    });"},{"line_number":63,"context_line":"  }"}],"source_content_type":"text/javascript","patch_set":6,"id":"7a2fa921_3b4b5889","line":60,"updated":"2015-10-06 22:56:36.000000000","message":"I didn\u0027t actually try this, but shouldn\u0027t this use the ifAllowed function:\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core/openstack-service-api/policy.service.js#L105-L114\n\nThe other hz-if directives use the ifXyz style function:\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core/cloud-services/hz-if-settings.directive.js#L99\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core/cloud-services/hz-if-services.directive.js#L85\n\nhttps://github.com/openstack/horizon/blob/master/openstack_dashboard/static/app/core/cloud-services/hz-if-nova-extensions.directive.js#L70","commit_id":"378fbc17251daf10dd474d82a9b605c86cd4a223"}],"openstack_dashboard/static/app/core/cloud-services/hz-if-policies.directive.spec.js":[{"author":{"_account_id":9622,"name":"Cindy Lu","email":"clu@us.ibm.com","username":"clu14"},"change_message_id":"c4a7424aeedfe765e7e71bd9deba951f3087e57d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    //////////////"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    function allowed() {"},{"line_number":60,"context_line":"      var element \u003d $compile(template)($scope);"},{"line_number":61,"context_line":"      expect(element.children().length).toBe(0);"},{"line_number":62,"context_line":"      expect(policyService.ifAllowed).toHaveBeenCalledWith(\u0027policy_rules\u0027);"},{"line_number":63,"context_line":""}],"source_content_type":"text/javascript","patch_set":7,"id":"5a2ca52d_aea5dd04","line":60,"updated":"2015-10-14 18:42:03.000000000","message":"nit: move element into beforeEach","commit_id":"57590e046b96d47f97dde4307794ae1cf70ee5a3"}],"openstack_dashboard/static/app/core/cloud-services/hz-policy-toggle.directive.js":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"82af013dfc539fc0b823ed05eab6943a78981ff8","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"  angular"},{"line_number":21,"context_line":"    .module(\u0027horizon.app.core.cloud-services\u0027)"},{"line_number":22,"context_line":"    .directive(\u0027hzPolicyToggle\u0027, hzPolicyToggle);"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"  hzPolicyToggle.$inject \u003d  ["},{"line_number":25,"context_line":"    \u0027hzPromiseToggleTemplateDirective\u0027,"}],"source_content_type":"text/javascript","patch_set":2,"id":"fa1b9901_f569218d","line":22,"updated":"2015-08-25 22:25:55.000000000","message":"Just for naming discussion, see my comment here:\n\nhttps://review.openstack.org/#/c/212125/7/openstack_dashboard/static/app/core/cloud-services/hz-service-enabled.directive.js\n\nLine 22\n\nI actually like hz-policy-toggle and think hz-policy-toggle works in this case.  But here are some other options to consider since it is plural vs singular.:\n\nhz-policies-toggle\nhz-required-policies","commit_id":"a24a8bf2a35c8a427b20a4b8687d6860cd961fec"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"b70d6118627845837c0a9cf411a86beb426c14fc","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"  angular"},{"line_number":21,"context_line":"    .module(\u0027horizon.app.core.cloud-services\u0027)"},{"line_number":22,"context_line":"    .directive(\u0027hzPolicyToggle\u0027, hzPolicyToggle);"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"  hzPolicyToggle.$inject \u003d  ["},{"line_number":25,"context_line":"    \u0027hzPromiseToggleTemplateDirective\u0027,"}],"source_content_type":"text/javascript","patch_set":2,"id":"da20952f_40d17b56","line":22,"in_reply_to":"fa1b9901_f569218d","updated":"2015-08-27 19:53:22.000000000","message":"Done","commit_id":"a24a8bf2a35c8a427b20a4b8687d6860cd961fec"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"82af013dfc539fc0b823ed05eab6943a78981ff8","unresolved":false,"context_lines":[{"line_number":33,"context_line":"   *"},{"line_number":34,"context_line":"   * @description"},{"line_number":35,"context_line":"   * This is to enable specifying conditional UI in a declarative way."},{"line_number":36,"context_line":"   * Some elements should only be visible when some certain policies passes."},{"line_number":37,"context_line":"   *"},{"line_number":38,"context_line":"   * @example"},{"line_number":39,"context_line":"   * Assume you have the following policy:"}],"source_content_type":"text/javascript","patch_set":2,"id":"fa1b9901_f573614c","line":36,"updated":"2015-08-25 22:25:55.000000000","message":"The grammar here needs improvement (existing directives have similarly poor grammar).\n\nI think it would be better with something like this:\n\nAdd this directive to any element containing content which should only be evaluated if the user has permission according to the specified policy rules. If the user has permission, the content will be evaluated. Otherwise, the content will not be compiled. In addition, the element and everything contained by it will be removed completely, leaving a simple HTML comment.\n\nThis is evaluated once per page load. In current horizon, this means it will get re-evaluated with events like the user opening another panel, changing logins, or changing their region.","commit_id":"a24a8bf2a35c8a427b20a4b8687d6860cd961fec"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"b70d6118627845837c0a9cf411a86beb426c14fc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"   *"},{"line_number":34,"context_line":"   * @description"},{"line_number":35,"context_line":"   * This is to enable specifying conditional UI in a declarative way."},{"line_number":36,"context_line":"   * Some elements should only be visible when some certain policies passes."},{"line_number":37,"context_line":"   *"},{"line_number":38,"context_line":"   * @example"},{"line_number":39,"context_line":"   * Assume you have the following policy:"}],"source_content_type":"text/javascript","patch_set":2,"id":"da20952f_a0e3b732","line":36,"in_reply_to":"fa1b9901_f573614c","updated":"2015-08-27 19:53:22.000000000","message":"Done","commit_id":"a24a8bf2a35c8a427b20a4b8687d6860cd961fec"}]}
