)]}'
{"openstack_dashboard/policy_backend.py":[{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"fc54fa9f0fdb32b0421e5be4e9353ebb31b3b2e7","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    _ENFORCER \u003d None"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def check(actions, request, target\u003d{}):"},{"line_number":63,"context_line":"    \"\"\"Check user permission."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    Check if the user has permission to the action according"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_15783dc3","line":62,"updated":"2014-12-10 18:57:22.000000000","message":"I think maybe target\u003dNone could be cleaner here, so that the same code chooses a default value both when the target is omitted as well as when its explicitly None.","commit_id":"4ed943c89108388a54ecd919a381a545c98fefa0"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"fca7d20b3b9d02afdced46a8965c87fa61fe7de9","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    :returns: boolean if the user has permission or not for the actions."},{"line_number":98,"context_line":"    \"\"\""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    if target is None:"},{"line_number":101,"context_line":"        target \u003d {}"},{"line_number":102,"context_line":"    user \u003d auth_utils.get_user(request)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_15559d4f","line":100,"updated":"2014-12-10 18:51:07.000000000","message":"Is it possible for target to be None here?  Doesn\u0027t the default parm exclude this?","commit_id":"4ed943c89108388a54ecd919a381a545c98fefa0"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"97785a79995c1803c66f9b2c049abb4531152e90","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    :returns: boolean if the user has permission or not for the actions."},{"line_number":98,"context_line":"    \"\"\""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    if target is None:"},{"line_number":101,"context_line":"        target \u003d {}"},{"line_number":102,"context_line":"    user \u003d auth_utils.get_user(request)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_559485e1","line":100,"in_reply_to":"3a961159_15559d4f","updated":"2014-12-10 18:54:22.000000000","message":"Nevermind, I see that None could be explicitly passed","commit_id":"4ed943c89108388a54ecd919a381a545c98fefa0"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"bef08784a5b6fc21025f82fab667400e52e1060e","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    :returns: boolean if the user has permission or not for the actions."},{"line_number":98,"context_line":"    \"\"\""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    if target is None:"},{"line_number":101,"context_line":"        target \u003d {}"},{"line_number":102,"context_line":"    user \u003d auth_utils.get_user(request)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_fff62bf8","line":100,"in_reply_to":"3a961159_559485e1","updated":"2014-12-10 21:21:41.000000000","message":"no, I botched that, let me fix it","commit_id":"4ed943c89108388a54ecd919a381a545c98fefa0"}],"openstack_dashboard/test/tests/policy.py":[{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"9a074fe820fee3d66f681f7c87a43cc01515ea37","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from openstack_dashboard.test import helpers as test"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class PolicyTestCase(test.TestCase):"},{"line_number":23,"context_line":"    def test_policy_file_load(self):"},{"line_number":24,"context_line":"        policy_backend.reset()"},{"line_number":25,"context_line":"        enforcer \u003d policy_backend._get_enforcer()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_c9671db6","line":22,"updated":"2014-11-20 20:49:23.000000000","message":"These tests seem like a mix of testing the policy_backend internals (which will be leaving to a new project), and the policy interface as seen through the dashboard.  I\u0027m wondering (but not sure) if there should be 2 test files here.\n\nHow much of this do you think will stay in dashboard?\n\nShould there be a policy_backend.reset as well to help facilitate testing?","commit_id":"cf2a681552e37a909b60e1825b6785291555d541"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"d08fdde9388b205d8ac5cab51707e2f0e4ccde87","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from openstack_dashboard.test import helpers as test"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"class PolicyTestCase(test.TestCase):"},{"line_number":23,"context_line":"    def test_policy_file_load(self):"},{"line_number":24,"context_line":"        policy_backend.reset()"},{"line_number":25,"context_line":"        enforcer \u003d policy_backend._get_enforcer()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_d2726610","line":22,"in_reply_to":"5a890539_c9671db6","updated":"2014-11-20 22:26:14.000000000","message":"I actually think all of this will move to django_openstack_auth. I should write new tests for the simplified policy.check method just around having the check method set and not set.","commit_id":"cf2a681552e37a909b60e1825b6785291555d541"}],"openstack_dashboard/test/tests/policy_backend.py":[{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"e07a0db37b8d56c84781c838c4e9018176096d28","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_ec42b566","line":1,"updated":"2014-11-25 15:01:46.000000000","message":"I\u0027m surprised you\u0027ve included this.  Mistake?","commit_id":"50a6d9710c646e9b97e67453036dbf3198516518"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"5852a0cba13849dee7d41311c4242490307fc78c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 Hewlett-Packard Development Company, L.P."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_dcb59ded","line":1,"in_reply_to":"5a890539_ec42b566","updated":"2014-11-25 19:57:50.000000000","message":"Good point. Just an oversight.","commit_id":"50a6d9710c646e9b97e67453036dbf3198516518"},{"author":{"_account_id":9981,"name":"Doug Fish","email":"drfish@us.ibm.com","username":"doug-fish"},"change_message_id":"4acf0870eff491d5a7bb6a9de66e6c07066ecd9b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        policy_backend.reset()"},{"line_number":34,"context_line":"        self.assertIsNone(policy_backend._ENFORCER)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @override_settings(POLICY_CHECK_FUNCTION\u003dpolicy_backend.check)"},{"line_number":37,"context_line":"    def test_check_admin_required_false(self):"},{"line_number":38,"context_line":"        policy_backend.reset()"},{"line_number":39,"context_line":"        value \u003d policy.check(((\"identity\", \"admin_required\"),),"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_78ca7150","line":36,"updated":"2014-11-20 23:33:11.000000000","message":"Thinking about this as strictly a unit test for the backend, I think you should get rid of the @override_settings, and the from openstack_dashboard import policy and just directly call policy_backend.check.  Then your test won\u0027t have any dependency on openstack_dashboard after the move either.","commit_id":"50a6d9710c646e9b97e67453036dbf3198516518"},{"author":{"_account_id":5623,"name":"David Lyle","email":"dklyle0@gmail.com","username":"david-lyle"},"change_message_id":"a463a2b8323387e739cbdd5ec830253cab7dcf4c","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        policy_backend.reset()"},{"line_number":34,"context_line":"        self.assertIsNone(policy_backend._ENFORCER)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    @override_settings(POLICY_CHECK_FUNCTION\u003dpolicy_backend.check)"},{"line_number":37,"context_line":"    def test_check_admin_required_false(self):"},{"line_number":38,"context_line":"        policy_backend.reset()"},{"line_number":39,"context_line":"        value \u003d policy.check(((\"identity\", \"admin_required\"),),"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_bf757a99","line":36,"in_reply_to":"5a890539_78ca7150","updated":"2014-11-21 22:47:11.000000000","message":"I\u0027ve posted a patch for the moved tests. They had to be reworked anyway to account for different testing infrastructure. https://review.openstack.org/#/c/136515/","commit_id":"50a6d9710c646e9b97e67453036dbf3198516518"}]}
