)]}'
{"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":15881,"name":"Limor Stotland","email":"limor.bortman@nokia.com","username":"LimorStotlamd"},"change_message_id":"6bd7a5349bdc7f11eed353078eb912b14be8263d","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"# ResourceMembers"},{"line_number":1110,"context_line":""},{"line_number":1111,"context_line":""},{"line_number":1112,"context_line":"def _get_criterion(res_name, member_id\u003dNone, is_owner\u003dTrue):"},{"line_number":1113,"context_line":"    if is_owner and member_id:"},{"line_number":1114,"context_line":"        return sa.and_("},{"line_number":1115,"context_line":"            models.ResourceMember.project_id \u003d\u003d security.get_project_id(),"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_d0994c7a","line":1112,"updated":"2015-11-12 06:26:46.000000000","message":"I think you need add a comment because it habit heard to get all the posibelteis","commit_id":"17c164e2cf1e7bbac26cbd5992c15fe6225cf739"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"b74aad072c1eab26ab1db34af8af73f2a9ab2a9d","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    # Note(lane): Sometimes tenant_A need to get resources of tenant_B,"},{"line_number":152,"context_line":"    # especially in resource sharing scenario, the resource owner need to"},{"line_number":153,"context_line":"    # check if the resource is used by a member."},{"line_number":154,"context_line":"    query \u003d (b.model_query(model) if \u0027project_id\u0027 in kwargs"},{"line_number":155,"context_line":"             else _secure_query(model))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    return query.filter_by(**kwargs).order_by(model.name).all()"}],"source_content_type":"text/x-python","patch_set":15,"id":"fa69d971_f0660dba","line":154,"range":{"start_line":154,"start_character":15,"end_line":154,"end_character":26},"updated":"2016-01-12 01:39:33.000000000","message":"Unable to understand this change. Will it be used for ResourceMember model ?","commit_id":"485499ca6c490913e869345f70f6bd9b8fbb0c3b"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"af6df8f11e8f35a03dcab117e28ee504fa3c81b9","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    # Note(lane): Sometimes tenant_A need to get resources of tenant_B,"},{"line_number":152,"context_line":"    # especially in resource sharing scenario, the resource owner need to"},{"line_number":153,"context_line":"    # check if the resource is used by a member."},{"line_number":154,"context_line":"    query \u003d (b.model_query(model) if \u0027project_id\u0027 in kwargs"},{"line_number":155,"context_line":"             else _secure_query(model))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    return query.filter_by(**kwargs).order_by(model.name).all()"}],"source_content_type":"text/x-python","patch_set":15,"id":"da6ed579_c6aab385","line":154,"range":{"start_line":154,"start_character":15,"end_line":154,"end_character":26},"in_reply_to":"da6ed579_8696fb92","updated":"2016-01-12 05:34:03.000000000","message":"As per https://review.openstack.org/#/c/244030/13/mistral/db/v2/sqlalchemy/models.py\n\nResourceMember is child class of MistralModelBase not MistralSecureModelBase so _secure_query will return b.model_query.\nThen It will be filtered by query.filter_by(**kwargs) line.\n\nSo I think we don\u0027t need this check.","commit_id":"485499ca6c490913e869345f70f6bd9b8fbb0c3b"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"7a91701d1103d313d9c37678a50dd86450036332","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    # Note(lane): Sometimes tenant_A need to get resources of tenant_B,"},{"line_number":152,"context_line":"    # especially in resource sharing scenario, the resource owner need to"},{"line_number":153,"context_line":"    # check if the resource is used by a member."},{"line_number":154,"context_line":"    query \u003d (b.model_query(model) if \u0027project_id\u0027 in kwargs"},{"line_number":155,"context_line":"             else _secure_query(model))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    return query.filter_by(**kwargs).order_by(model.name).all()"}],"source_content_type":"text/x-python","patch_set":15,"id":"da6ed579_e19d615a","line":154,"range":{"start_line":154,"start_character":15,"end_line":154,"end_character":26},"in_reply_to":"da6ed579_c6aab385","updated":"2016-01-12 06:07:20.000000000","message":"Hi, hardik, let me take an example for you, probably this function is used as below in workflow sharing scenario:\n\n    crons_associated_with_workflow_in_other_tenant_scope \u003d _get_collection_sorted_by_name(models.CronTrigger, project_id\u003d\u0027xxx\u0027, workflow_id\u003d\u0027xxx\u0027)\n\nThe model it is querying is not ResouceMember.\n\nAs a resource owner, when I want to delete a workflow sharing to a specific tenant, I need to check if that workflow is being used by the tenant, the request will be denied if the usage exists.","commit_id":"485499ca6c490913e869345f70f6bd9b8fbb0c3b"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"0504b0c1ddbb6aba9d5d7977aecf15e25bb9b536","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    # Note(lane): Sometimes tenant_A need to get resources of tenant_B,"},{"line_number":152,"context_line":"    # especially in resource sharing scenario, the resource owner need to"},{"line_number":153,"context_line":"    # check if the resource is used by a member."},{"line_number":154,"context_line":"    query \u003d (b.model_query(model) if \u0027project_id\u0027 in kwargs"},{"line_number":155,"context_line":"             else _secure_query(model))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    return query.filter_by(**kwargs).order_by(model.name).all()"}],"source_content_type":"text/x-python","patch_set":15,"id":"da6ed579_bce6b0e6","line":154,"range":{"start_line":154,"start_character":15,"end_line":154,"end_character":26},"in_reply_to":"da6ed579_e19d615a","updated":"2016-01-12 06:29:55.000000000","message":"Hmm.... I was confused. I thought it is used for ResourceMember Model. Thanks !!!","commit_id":"485499ca6c490913e869345f70f6bd9b8fbb0c3b"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"e427341f0d3613ef2686c1bfddac2c5275df2bfa","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    # Note(lane): Sometimes tenant_A need to get resources of tenant_B,"},{"line_number":152,"context_line":"    # especially in resource sharing scenario, the resource owner need to"},{"line_number":153,"context_line":"    # check if the resource is used by a member."},{"line_number":154,"context_line":"    query \u003d (b.model_query(model) if \u0027project_id\u0027 in kwargs"},{"line_number":155,"context_line":"             else _secure_query(model))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    return query.filter_by(**kwargs).order_by(model.name).all()"}],"source_content_type":"text/x-python","patch_set":15,"id":"da6ed579_8696fb92","line":154,"range":{"start_line":154,"start_character":15,"end_line":154,"end_character":26},"in_reply_to":"fa69d971_f0660dba","updated":"2016-01-12 05:10:09.000000000","message":"Yes, when deleting a resource membership, we need to check if the resource  has been used by that member(another tenant). So, we need to support query resources by project_id in db operation layer.","commit_id":"485499ca6c490913e869345f70f6bd9b8fbb0c3b"}],"mistral/tests/unit/db/v2/test_sqlalchemy_db_api.py":[{"author":{"_account_id":8592,"name":"Anastasia Kuznetsova","email":"akuznetsova@mirantis.com","username":"nastya-kuz"},"change_message_id":"6442794d2f6e66079a8319cc698fbc31d9c6782a","unresolved":false,"context_lines":[{"line_number":1587,"context_line":""},{"line_number":1588,"context_line":"        self.assertEqual(0, len(fetched))"},{"line_number":1589,"context_line":""},{"line_number":1590,"context_line":"    def test_delete_resource_member_not_owner(self):"},{"line_number":1591,"context_line":"        created \u003d db_api.create_resource_member(RESOURCE_MEMBERS[0])"},{"line_number":1592,"context_line":""},{"line_number":1593,"context_line":"        # Switch to another tenant."}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_814fe132","line":1590,"updated":"2015-11-12 13:30:39.000000000","message":"What do you think about adding one more negative test that check that user can\u0027t delete already deleted resource_member.","commit_id":"17c164e2cf1e7bbac26cbd5992c15fe6225cf739"}]}
