)]}'
{"etc/policy.json":[{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"83fec79f44df079a2f7798c13c3878b192de78de","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"default\": \"\","},{"line_number":3,"context_line":"    \"manage_image_cache\": \"role:admin\""},{"line_number":4,"context_line":"}"}],"source_content_type":"application/json","patch_set":4,"id":"AAAALn%2F%2F%2Ftc%3D","line":3,"updated":"2012-10-22 16:25:37.000000000","message":"Assuming this file is intended to be an example conf, could we show how to have a list of rules?\n\nsomething like\n\"manage_image_cache\": \"role:admin role:nobody\"","commit_id":"e5f005c969ffa655ec528c08131767bd926539ee"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ac15927d9fd9af049de4c78922aa48d37a81b395","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"default\": \"\","},{"line_number":3,"context_line":"    \"manage_image_cache\": \"role:admin\""},{"line_number":4,"context_line":"}"}],"source_content_type":"application/json","patch_set":4,"id":"AAAALn%2F%2F%2Fog%3D","line":3,"in_reply_to":"AAAALn%2F%2F%2Ftc%3D","updated":"2012-10-22 18:14:49.000000000","message":"Well, your example would be a syntax error; the syntax actually uses \"and\" and \"or\" conjunctions, in addition to supporting parentheses and the \"not\" operator.  Feel free to suggest something, but I think to fully express what we can put here, we really need a full-up document…","commit_id":"e5f005c969ffa655ec528c08131767bd926539ee"}],"glance/api/policy.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"a7b9265a7f44e24854ca3baa88cf559853e3eb6f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2011 OpenStack, LLC."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FIUA%3D","line":2,"updated":"2012-10-12 21:01:45.000000000","message":"can we change this to 2012?","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4cb736044a31c0cf3072f6aa35a828cb5e04ae81","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2011 OpenStack, LLC."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FISI%3D","line":2,"in_reply_to":"AAAALH%2F%2FISc%3D","updated":"2012-10-12 21:20:17.000000000","message":"I do not consider my changes sufficient to require an increment in the year.  If I had rewritten the file, like I did with the openstack/common/policy.py, it would be another matter.","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0efa55c4ce99e80dd648cd5623c89f34452eb4ec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2011 OpenStack, LLC."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FISc%3D","line":2,"in_reply_to":"AAAALH%2F%2FITA%3D","updated":"2012-10-12 21:13:24.000000000","message":"why not?, would like to know. Also, why not use standard 2011-2012 style for Copyright?","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"113fb4c356864936932f1bed0b8125f3531fd1a6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2011 OpenStack, LLC."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FITA%3D","line":2,"in_reply_to":"AAAALH%2F%2FIUA%3D","updated":"2012-10-12 21:08:18.000000000","message":"No.","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"498f8bdaf18b8324d9de5cc7b3160db11589ffdd","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self.policy_path:"},{"line_number":62,"context_line":"            rules \u003d self._read_policy_file()"},{"line_number":63,"context_line":"            LOG.debug(_(\u0027Loaded policy rules: %s\u0027) %"},{"line_number":64,"context_line":"                      dict((k, str(v)) for k, v in rules.items()))"},{"line_number":65,"context_line":"        else:"},{"line_number":66,"context_line":"            rules \u003d DEFAULT_RULES"},{"line_number":67,"context_line":"            LOG.debug(_(\u0027Using default policy rules: %s\u0027) %"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FIHI%3D","line":64,"updated":"2012-10-13 02:13:58.000000000","message":"Let\u0027s kill the duplication of the generator since the code is identical.","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ce64d3990b9821fa7904657252f7a42994e0bbd2","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self.policy_path:"},{"line_number":62,"context_line":"            rules \u003d self._read_policy_file()"},{"line_number":63,"context_line":"            LOG.debug(_(\u0027Loaded policy rules: %s\u0027) %"},{"line_number":64,"context_line":"                      dict((k, str(v)) for k, v in rules.items()))"},{"line_number":65,"context_line":"        else:"},{"line_number":66,"context_line":"            rules \u003d DEFAULT_RULES"},{"line_number":67,"context_line":"            LOG.debug(_(\u0027Using default policy rules: %s\u0027) %"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FHrQ%3D","line":64,"in_reply_to":"AAAALH%2F%2FIHI%3D","updated":"2012-10-15 15:27:04.000000000","message":"Makes sense…","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"498f8bdaf18b8324d9de5cc7b3160db11589ffdd","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            with open(self.policy_path) as fap:"},{"line_number":90,"context_line":"                raw_contents \u003d fap.read()"},{"line_number":91,"context_line":"                self.policy_file_contents \u003d dict("},{"line_number":92,"context_line":"                    (k, policy.parse_rule(v))"},{"line_number":93,"context_line":"                    for k, v in json.loads(raw_contents).items())"},{"line_number":94,"context_line":"            self.policy_file_mtime \u003d mtime"},{"line_number":95,"context_line":"        return self.policy_file_contents"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FIHA%3D","line":92,"updated":"2012-10-13 02:13:58.000000000","message":"This is a little difficult to read. Can we split this up into at least two separate lines?\n\n  items \u003d json.loads(raw_contents).items()\n  self.policy_file_contents \u003d dict((k, policy.parse_rule(v) for k, v in items)","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ce64d3990b9821fa7904657252f7a42994e0bbd2","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            with open(self.policy_path) as fap:"},{"line_number":90,"context_line":"                raw_contents \u003d fap.read()"},{"line_number":91,"context_line":"                self.policy_file_contents \u003d dict("},{"line_number":92,"context_line":"                    (k, policy.parse_rule(v))"},{"line_number":93,"context_line":"                    for k, v in json.loads(raw_contents).items())"},{"line_number":94,"context_line":"            self.policy_file_mtime \u003d mtime"},{"line_number":95,"context_line":"        return self.policy_file_contents"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FHrM%3D","line":92,"in_reply_to":"AAAALH%2F%2FIHA%3D","updated":"2012-10-15 15:27:04.000000000","message":"Again, makes sense… :)","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"498f8bdaf18b8324d9de5cc7b3160db11589ffdd","unresolved":false,"context_lines":[{"line_number":100,"context_line":"           :param context: Glance request context"},{"line_number":101,"context_line":"           :param action: String representing the action to be checked"},{"line_number":102,"context_line":"           :param object: Dictionary representing the object of the action."},{"line_number":103,"context_line":"           :param do_raise: True to raise an exception, False to return False."},{"line_number":104,"context_line":"           :raises: `glance.common.exception.Forbidden`"},{"line_number":105,"context_line":"           :returns: A non-False value if access is allowed."},{"line_number":106,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FIG8%3D","line":103,"updated":"2012-10-13 02:13:58.000000000","message":"Can we make this feature its own function rather than changing the core behavior of the core enforce function through a kwarg?\n\n  def soft_enforce(self, context, action, target):\n      try:\n          self.enforce(self, context, action)\n      except exception.Forbidden:\n          return False\n      else:\n          return True","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ce64d3990b9821fa7904657252f7a42994e0bbd2","unresolved":false,"context_lines":[{"line_number":100,"context_line":"           :param context: Glance request context"},{"line_number":101,"context_line":"           :param action: String representing the action to be checked"},{"line_number":102,"context_line":"           :param object: Dictionary representing the object of the action."},{"line_number":103,"context_line":"           :param do_raise: True to raise an exception, False to return False."},{"line_number":104,"context_line":"           :raises: `glance.common.exception.Forbidden`"},{"line_number":105,"context_line":"           :returns: A non-False value if access is allowed."},{"line_number":106,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2FHrI%3D","line":103,"in_reply_to":"AAAALH%2F%2FIG8%3D","updated":"2012-10-15 15:27:04.000000000","message":"How about a check() vs. enforce() for that?  And I actually want to return whatever common_policy.check() returns in case we ever decide to reintroduce the \"case\" feature.","commit_id":"26ed8dcfb0a2248139740bfd534ac9edaba617ab"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"83fec79f44df079a2f7798c13c3878b192de78de","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.policy_file_contents \u003d None"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def set_rules(self, rules):"},{"line_number":55,"context_line":"        \"\"\"Create a new Brain based on the provided dict of rules\"\"\""},{"line_number":56,"context_line":"        rules_obj \u003d policy.Rules(rules, self.default_rule)"},{"line_number":57,"context_line":"        policy.set_rules(rules_obj)"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALn%2F%2F%2Fu0%3D","line":55,"updated":"2012-10-22 16:25:37.000000000","message":"This docstring needs to be updated since there is no longer a brain","commit_id":"e5f005c969ffa655ec528c08131767bd926539ee"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ac15927d9fd9af049de4c78922aa48d37a81b395","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        self.policy_file_contents \u003d None"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def set_rules(self, rules):"},{"line_number":55,"context_line":"        \"\"\"Create a new Brain based on the provided dict of rules\"\"\""},{"line_number":56,"context_line":"        rules_obj \u003d policy.Rules(rules, self.default_rule)"},{"line_number":57,"context_line":"        policy.set_rules(rules_obj)"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALn%2F%2F%2Foc%3D","line":55,"in_reply_to":"AAAALn%2F%2F%2Fu0%3D","updated":"2012-10-22 18:14:49.000000000","message":"Point…","commit_id":"e5f005c969ffa655ec528c08131767bd926539ee"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"83fec79f44df079a2f7798c13c3878b192de78de","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            self.policy_file_mtime \u003d mtime"},{"line_number":99,"context_line":"        return self.policy_file_contents"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _check(self, context, rule, target, *args, **kwargs):"},{"line_number":102,"context_line":"        \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"           :param context: Glance request context"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALn%2F%2F%2Ftk%3D","line":101,"updated":"2012-10-22 16:25:37.000000000","message":"why does this functionality need to be broken out from the enforce function? Can\u0027t check just be an alias for enforce?","commit_id":"e5f005c969ffa655ec528c08131767bd926539ee"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ac15927d9fd9af049de4c78922aa48d37a81b395","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            self.policy_file_mtime \u003d mtime"},{"line_number":99,"context_line":"        return self.policy_file_contents"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _check(self, context, rule, target, *args, **kwargs):"},{"line_number":102,"context_line":"        \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"           :param context: Glance request context"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALn%2F%2F%2FoQ%3D","line":101,"in_reply_to":"AAAALn%2F%2F%2Ftk%3D","updated":"2012-10-22 18:14:49.000000000","message":"This was done in response to a -1 from Waldon, who did not like the \"do_raise\" parameter I gave to enforce().  Without that parameter, this is the best DRY-compliant way of allowing for both enforce() behavior and check() behavior.","commit_id":"e5f005c969ffa655ec528c08131767bd926539ee"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"6b247187595fe831dd955af00a2803c3936c1bdf","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        return self._check(context, action, target,"},{"line_number":130,"context_line":"                           exception.Forbidden, action\u003daction)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def check(self, context, action, target):"},{"line_number":133,"context_line":"        \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"           :param context: Glance request context"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALn%2F%2F%2Bjk%3D","line":132,"updated":"2012-10-23 18:41:02.000000000","message":"This is a great way to solve the \u0027do_raise\u0027 problem!","commit_id":"d8494b8c624b11661d694b9dc1b4051c81fdb6b1"}]}
