)]}'
{"gnocchi/rest/__init__.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"056fa08fb12e7c6f5887ff364be1f38ed418b2f8","unresolved":false,"context_lines":[{"line_number":982,"context_line":"            created_filter \u003d \\"},{"line_number":983,"context_line":"                {\"and\": [{\"\u003d\": {\"created_by_user_id\": user}},"},{"line_number":984,"context_line":"                         {\"\u003d\": {\"created_by_project_id\": project}}]}"},{"line_number":985,"context_line":"            attr_filter \u003d {\"or\": [{\"\u003d\": {\"project_id\": project}},"},{"line_number":986,"context_line":"                                  created_filter]}"},{"line_number":987,"context_line":"        else:"},{"line_number":988,"context_line":"            attr_filter \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_7bd9dd82","line":985,"updated":"2015-12-24 11:50:18.000000000","message":"This should go into one variable, and probably also allow user_id","commit_id":"61407ff2a67f80ae6f243975b1533e51df467056"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"056fa08fb12e7c6f5887ff364be1f38ed418b2f8","unresolved":false,"context_lines":[{"line_number":1147,"context_line":"            if attr_filter:"},{"line_number":1148,"context_line":"                attr_filter \u003d {\"and\": ["},{"line_number":1149,"context_line":"                    {\"or\": [created_filter,"},{"line_number":1150,"context_line":"                            {\"\u003d\": {\"project_id\": project}}]},"},{"line_number":1151,"context_line":"                    attr_filter,"},{"line_number":1152,"context_line":"                ]}"},{"line_number":1153,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_db37b1ae","line":1150,"updated":"2015-12-24 11:50:18.000000000","message":"ditto, user_id","commit_id":"61407ff2a67f80ae6f243975b1533e51df467056"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"056fa08fb12e7c6f5887ff364be1f38ed418b2f8","unresolved":false,"context_lines":[{"line_number":1152,"context_line":"                ]}"},{"line_number":1153,"context_line":"            else:"},{"line_number":1154,"context_line":"                attr_filter \u003d {\"and\": ["},{"line_number":1155,"context_line":"                    {\"or\": [created_filter,"},{"line_number":1156,"context_line":"                            {\"\u003d\": {\"project_id\": project}}]},"},{"line_number":1157,"context_line":"                ]}"},{"line_number":1158,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_fb3aad97","line":1155,"updated":"2015-12-24 11:50:18.000000000","message":"ditto","commit_id":"61407ff2a67f80ae6f243975b1533e51df467056"},{"author":{"_account_id":18540,"name":"ke liang","email":"ke.liang@easystack.cn","username":"keliang"},"change_message_id":"74ecbd25a7c9f9860fb120dad6cc8ae4818b5989","unresolved":false,"context_lines":[{"line_number":981,"context_line":"                {\"and\": [{\"\u003d\": {\"created_by_user_id\": user}},"},{"line_number":982,"context_line":"                         {\"\u003d\": {\"created_by_project_id\": project}}]}"},{"line_number":983,"context_line":"            attr_filter \u003d {\"or\": [{\"\u003d\": {\"project_id\": project}},"},{"line_number":984,"context_line":"                                  created_filter]}"},{"line_number":985,"context_line":""},{"line_number":986,"context_line":"        else:"},{"line_number":987,"context_line":"            attr_filter \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a7b0d38_423ab2cd","line":984,"updated":"2015-12-28 12:18:15.000000000","message":"It could get all resources from project you provide,but not get user private resources. Resources  are created by ceilometer dispatcher using a different project and user id. Correct me if I\u0027m wrong.","commit_id":"ec400bbec547d8e1f48363195ba64e391e52b5e8"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"655aea4d5a411eddaea33ca4e00b71b7741d11c6","unresolved":false,"context_lines":[{"line_number":977,"context_line":"            attr_filter \u003d {\"or\": ["},{"line_number":978,"context_line":"                {\"\u003d\": {\"project_id\": project}},"},{"line_number":979,"context_line":"                {\"\u003d\": {\"created_by_project_id\": project}},"},{"line_number":980,"context_line":"            ]}"},{"line_number":981,"context_line":"        else:"},{"line_number":982,"context_line":"            attr_filter \u003d None"},{"line_number":983,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_c6ace1ef","line":980,"updated":"2016-01-19 07:07:44.000000000","message":"That looks a bit weird, I agree that the default should be this. But if the policy.json change, this filter can become wrong. I would propose something like this:\n\n\nChanging \"list resource\" policy to \"rule:admin_or_creator or rule:resource_owner\"\n\n\nAnd checking policy with something like that:\n\n    attr_filter \u003d []\n    try:\n        enforce(\"list resource\",\n            {\"resource_type\": self._resource_type,\n             \"project_id\": project})\n    except webob.exc.HTTPForbidden:\n        pass\n    else:\n        attr_filter.append({\"\u003d\": {\"project_id\": project})\n    \n    try:\n        enforce(\"list resource\",\n            {\"resource_type\": self._resource_type,\n             \"created_by_project_id\": project})\n    except webob.exc.HTTPForbidden:\n        pass\n    else:\n        attr_filter.append({\"\u003d\": {\"created_by_project_id\": project})\n    \n    if not attr_filter:\n        raise webob.exc.HTTPForbidden(\"XXXXXXXX\")\n    \n    attr_filter \u003d {\"or\": attr_filter}","commit_id":"6ef6fc503c96fc2f29451dfcb6f21932a85f2c7c"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"9202abbb18c02f4bfddb4f723d9819aeb2ad5420","unresolved":false,"context_lines":[{"line_number":977,"context_line":"            attr_filter \u003d {\"or\": ["},{"line_number":978,"context_line":"                {\"\u003d\": {\"project_id\": project}},"},{"line_number":979,"context_line":"                {\"\u003d\": {\"created_by_project_id\": project}},"},{"line_number":980,"context_line":"            ]}"},{"line_number":981,"context_line":"        else:"},{"line_number":982,"context_line":"            attr_filter \u003d None"},{"line_number":983,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_df3a58cd","line":980,"in_reply_to":"ba63e191_c6ace1ef","updated":"2016-01-19 10:58:18.000000000","message":"Done","commit_id":"6ef6fc503c96fc2f29451dfcb6f21932a85f2c7c"}],"gnocchi/tests/test_rest.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"056fa08fb12e7c6f5887ff364be1f38ed418b2f8","unresolved":false,"context_lines":[{"line_number":1522,"context_line":"        self.assertGreaterEqual(len(resources), 1)"},{"line_number":1523,"context_line":"        self.assertEqual(created_resource, resources[0])"},{"line_number":1524,"context_line":""},{"line_number":1525,"context_line":"    def test_search_resources_with_another_project_id(self):"},{"line_number":1526,"context_line":"        u1 \u003d str(uuid.uuid4())"},{"line_number":1527,"context_line":"        result \u003d self.app.post_json("},{"line_number":1528,"context_line":"            \"/v1/resource/generic\","}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_9b41290e","line":1525,"updated":"2015-12-24 11:50:18.000000000","message":"If it\u0027s possible, it\u0027d be better to have these tests as Gabbi ones.","commit_id":"61407ff2a67f80ae6f243975b1533e51df467056"},{"author":{"_account_id":18137,"name":"Xia Linjuan","email":"ljxiash@cn.ibm.com","username":"xialinjuan"},"change_message_id":"02b0a163aa5d068778309280991272719775bcaa","unresolved":false,"context_lines":[{"line_number":1532,"context_line":"                \"user_id\": u1,"},{"line_number":1533,"context_line":"                \"project_id\": FakeMemcache.PROJECT_ID_2,"},{"line_number":1534,"context_line":"            })"},{"line_number":1535,"context_line":"        g \u003d json.loads(result.text)"},{"line_number":1536,"context_line":""},{"line_number":1537,"context_line":"        with self.app.use_another_user():"},{"line_number":1538,"context_line":"            result \u003d self.app.post_json("}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_9edd2ce2","line":1535,"range":{"start_line":1535,"start_character":8,"end_line":1535,"end_character":9},"updated":"2015-12-21 09:16:51.000000000","message":"Could you please use more meaningful name?","commit_id":"61407ff2a67f80ae6f243975b1533e51df467056"},{"author":{"_account_id":18137,"name":"Xia Linjuan","email":"ljxiash@cn.ibm.com","username":"xialinjuan"},"change_message_id":"02b0a163aa5d068778309280991272719775bcaa","unresolved":false,"context_lines":[{"line_number":1545,"context_line":"                })"},{"line_number":1546,"context_line":"            j \u003d json.loads(result.text)"},{"line_number":1547,"context_line":"            g_found \u003d False"},{"line_number":1548,"context_line":"            j_found \u003d False"},{"line_number":1549,"context_line":""},{"line_number":1550,"context_line":"            result \u003d self.app.post_json("},{"line_number":1551,"context_line":"                \"/v1/search/resource/generic\","}],"source_content_type":"text/x-python","patch_set":2,"id":"3a7e1126_1ef05c66","line":1548,"updated":"2015-12-21 09:16:51.000000000","message":"Could you please use more meaningful name?","commit_id":"61407ff2a67f80ae6f243975b1533e51df467056"}]}
