)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"cbeddef6bbe4d129b66b03768ea667a3e513d0b8","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1331836"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I94cb3383eb1fed793934719603f888dbbdbbd85a"},{"line_number":18,"context_line":"Co-Authored-By: Susanne Balle \u003csleipnir012@gmail.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1ae5cdf2_da90fbef","line":17,"updated":"2014-06-24 09:06:53.000000000","message":"DocImpact flag seems required because it impacts others component config.","commit_id":"2144050b0c7b150e8f121bc149a49b99b607c037"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"0ac47029d76807cc165c804385155da2460964ad","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1331836"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I94cb3383eb1fed793934719603f888dbbdbbd85a"},{"line_number":18,"context_line":"Co-Authored-By: Susanne Balle \u003csleipnir012@gmail.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1ae5cdf2_cef6785d","line":17,"in_reply_to":"1ae5cdf2_da90fbef","updated":"2014-06-24 12:54:06.000000000","message":"Done","commit_id":"2144050b0c7b150e8f121bc149a49b99b607c037"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"723703b465c7d26dd0df68a33d750dc7d6801e58","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Kyle Mestery \u003ckmestery@cisco.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-06-27 13:38:12 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add advsvc role to neutron policy file"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add in a default \"advsvc\" user and the logic in the Neutron policy"},{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_c4d36d35","line":7,"updated":"2014-08-01 03:59:31.000000000","message":"The name advsvc is probably okay.  But, I wonder if there is a better choice.  Is it a given that any advanced service will have ability to view networks and manipulate ports on any admin?\n\nWhat about naming the roll something a little more precise like \"port_admin\", \"connect_to_tenant_networks\", or something.  I don\u0027t think I\u0027ve quite got it with either of these names but do you get the idea?","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"777fab2f27de10658936e0630c4b358dfaf97f70","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add advsvc role to neutron policy file"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add in a default \"advsvc\" user and the logic in the Neutron policy"},{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_5a9c785d","line":9,"updated":"2014-07-17 07:54:31.000000000","message":"user or role ?","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":12376,"name":"Skyler Berg","inactive":true},"change_message_id":"b05f9ce2439133c67d324555e07ed01ca3aebeea","unresolved":false,"context_lines":[{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"},{"line_number":13,"context_line":"a user to put ports on other tenants networks. Be default, we do not"},{"line_number":14,"context_line":"define any roles for the policy \"context_is_advsvc\", but rely on"},{"line_number":15,"context_line":"operators to specify the likely value of \"role advsvc\"."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_4966d1bc","line":13,"updated":"2014-07-17 00:37:06.000000000","message":"\"Be default\" should be \"By default\".","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"777fab2f27de10658936e0630c4b358dfaf97f70","unresolved":false,"context_lines":[{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"},{"line_number":13,"context_line":"a user to put ports on other tenants networks. Be default, we do not"},{"line_number":14,"context_line":"define any roles for the policy \"context_is_advsvc\", but rely on"},{"line_number":15,"context_line":"operators to specify the likely value of \"role advsvc\"."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_3a8184c3","line":13,"updated":"2014-07-17 07:54:31.000000000","message":"typo: \"By default,\"\n\nby default, context_is_advsvc is associated to role:advsvc in policy.json","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"add415c03cf22b5018e2b54dcb401f618f1d10ce","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add advsvc role to neutron policy file"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add in a default \"advsvc\" user and the logic in the Neutron policy"},{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"baa201ad_366d5233","line":9,"updated":"2014-10-14 12:07:09.000000000","message":"why is \"advsvc\" not \"advanced_service\"\nthat would be a lot more user friendly","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"78aa67f5c6ef431a5c9bce642270751464cfc74f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add advsvc role to neutron policy file"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add in a default \"advsvc\" user and the logic in the Neutron policy"},{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"baa201ad_547987c6","line":9,"in_reply_to":"baa201ad_366d5233","updated":"2014-10-17 15:12:45.000000000","message":"We chose this after discussion with a few people, please see Susanne\u0027s comments for more info.","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"3b01ad06fa984620ead840476b4b2ee79c5af8d4","unresolved":false,"context_lines":[{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"},{"line_number":13,"context_line":"a user to put ports on other tenants networks. Be default, we do not"},{"line_number":14,"context_line":"define any roles for the policy \"context_is_advsvc\", but rely on"},{"line_number":15,"context_line":"operators to specify the likely value of \"role advsvc\"."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"baa201ad_1e9eca54","line":13,"updated":"2014-10-13 13:03:27.000000000","message":"By","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"78aa67f5c6ef431a5c9bce642270751464cfc74f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"infrastructure which will allow this user to create/get/update/delete"},{"line_number":11,"context_line":"ports on other tenants networks, as well as view other tenants"},{"line_number":12,"context_line":"networks. This is for the use case of letting advanced services have"},{"line_number":13,"context_line":"a user to put ports on other tenants networks. Be default, we do not"},{"line_number":14,"context_line":"define any roles for the policy \"context_is_advsvc\", but rely on"},{"line_number":15,"context_line":"operators to specify the likely value of \"role advsvc\"."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"baa201ad_146c5f07","line":13,"in_reply_to":"baa201ad_1e9eca54","updated":"2014-10-17 15:12:45.000000000","message":"Done","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"}],"etc/policy.json":[{"author":{"_account_id":11685,"name":"Stephen Balukoff","email":"stephen@balukoff.com","username":"sbalukoff"},"change_message_id":"f4128ddb0190180c6d8168f413db605fafa5bf35","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    \"update_port:binding:host_id\": \"rule:admin_only\","},{"line_number":67,"context_line":"    \"update_port:binding:profile\": \"rule:admin_only\","},{"line_number":68,"context_line":"    \"update_port:mac_learning_enabled\": \"rule:admin_or_network_advsvc_owner\","},{"line_number":69,"context_line":"    \"delete_port\": \"rule:admin_or_owner\","},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    \"create_router:external_gateway_info:enable_snat\": \"rule:admin_only\","},{"line_number":72,"context_line":"    \"update_router:external_gateway_info:enable_snat\": \"rule:admin_only\","}],"source_content_type":"application/json","patch_set":1,"id":"1ae5cdf2_03427667","line":69,"updated":"2014-06-19 18:18:16.000000000","message":"If an advanced service can create or update ports, shouldn\u0027t it also be able to delete ports?  (Otherwise, how is it going to clean up after itself?)","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d6227319eb0a1419c9020497efb9a95712db17ad","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    \"update_port:binding:host_id\": \"rule:admin_only\","},{"line_number":67,"context_line":"    \"update_port:binding:profile\": \"rule:admin_only\","},{"line_number":68,"context_line":"    \"update_port:mac_learning_enabled\": \"rule:admin_or_network_advsvc_owner\","},{"line_number":69,"context_line":"    \"delete_port\": \"rule:admin_or_owner\","},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    \"create_router:external_gateway_info:enable_snat\": \"rule:admin_only\","},{"line_number":72,"context_line":"    \"update_router:external_gateway_info:enable_snat\": \"rule:admin_only\","}],"source_content_type":"application/json","patch_set":1,"id":"1ae5cdf2_69ca396f","line":69,"in_reply_to":"1ae5cdf2_03427667","updated":"2014-06-19 19:04:54.000000000","message":"Crap, I thought I had that in there.","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":10310,"name":"Mandeep Dhami","email":"dhami@noironetworks.com","username":"mandeepdhami"},"change_message_id":"69a7d53a84315d6767d5724d968905a6bb2c3eb7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"context_is_advsvc\":  \"role:advsvc\","},{"line_number":4,"context_line":"    \"admin_or_network_owner\": \"rule:context_is_admin or tenant_id:%(network:tenant_id)s\","},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    \"admin_or_network_owner_or_advsvc\": \"rule:context_is_admin or tenant_id:%(network:tenant_id)s or rule:context_is_advsvc\","},{"line_number":7,"context_line":"    \"admin_or_owner_or_advsvc\": \"rule:context_is_admin or tenant_id:%(tenant_id)s or rule:context_is_advsvc\","}],"source_content_type":"application/json","patch_set":3,"id":"1ae5cdf2_6c6962bd","line":4,"updated":"2014-06-19 21:48:44.000000000","message":"This key is repeated below (line 9)","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d096828e1433e3d6a089113cd21f7d2b7919282c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"{"},{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"context_is_advsvc\":  \"role:advsvc\","},{"line_number":4,"context_line":"    \"admin_or_network_owner\": \"rule:context_is_admin or tenant_id:%(network:tenant_id)s\","},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    \"admin_or_network_owner_or_advsvc\": \"rule:context_is_admin or tenant_id:%(network:tenant_id)s or rule:context_is_advsvc\","},{"line_number":7,"context_line":"    \"admin_or_owner_or_advsvc\": \"rule:context_is_admin or tenant_id:%(tenant_id)s or rule:context_is_advsvc\","}],"source_content_type":"application/json","patch_set":3,"id":"1ae5cdf2_c2d31fff","line":4,"in_reply_to":"1ae5cdf2_6c6962bd","updated":"2014-06-19 23:50:52.000000000","message":"Done","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"abffabe880377b093b820a7126f4511ef7620701","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    \"delete_subnet\": \"rule:admin_or_network_owner\","},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    \"create_network\": \"\","},{"line_number":29,"context_line":"    \"get_network\": \"rule:admin_or_owner or rule:admin_or_owner_or_advsvc or rule:shared or rule:external\","},{"line_number":30,"context_line":"    \"get_network:router:external\": \"rule:regular_user\","},{"line_number":31,"context_line":"    \"get_network:segments\": \"rule:admin_only\","},{"line_number":32,"context_line":"    \"get_network:provider:network_type\": \"rule:admin_only\","}],"source_content_type":"application/json","patch_set":3,"id":"1ae5cdf2_5bd8d11d","line":29,"updated":"2014-06-20 07:56:56.000000000","message":"it you expand the rules making this policy you\u0027ll find a bit of repetition.\nI thin you will obtain the same effect by using only:\n\nrule:admin_or_owner or rule:external or role:advsvc","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"a6fef0db7f8e4081eb72df94bf6f4b9b15ef30b4","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    \"delete_subnet\": \"rule:admin_or_network_owner\","},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    \"create_network\": \"\","},{"line_number":29,"context_line":"    \"get_network\": \"rule:admin_or_owner or rule:admin_or_owner_or_advsvc or rule:shared or rule:external\","},{"line_number":30,"context_line":"    \"get_network:router:external\": \"rule:regular_user\","},{"line_number":31,"context_line":"    \"get_network:segments\": \"rule:admin_only\","},{"line_number":32,"context_line":"    \"get_network:provider:network_type\": \"rule:admin_only\","}],"source_content_type":"application/json","patch_set":3,"id":"1ae5cdf2_139c5b69","line":29,"in_reply_to":"1ae5cdf2_5bd8d11d","updated":"2014-06-24 02:35:52.000000000","message":"Done","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"abffabe880377b093b820a7126f4511ef7620701","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    \"delete_network\": \"rule:admin_or_owner\","},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    \"create_port\": \"\","},{"line_number":51,"context_line":"    \"create_port:mac_address\": \"rule:admin_or_network_or_advsvc_owner\","},{"line_number":52,"context_line":"    \"create_port:fixed_ips\": \"rule:admin_or_network_or_advsvc_owner\","},{"line_number":53,"context_line":"    \"create_port:port_security_enabled\": \"rule:admin_or_network_or_advsvc_owner\","},{"line_number":54,"context_line":"    \"create_port:binding:host_id\": \"rule:admin_only\","}],"source_content_type":"application/json","patch_set":3,"id":"1ae5cdf2_7beaeda0","line":51,"updated":"2014-06-20 07:56:56.000000000","message":"same as above","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"a6fef0db7f8e4081eb72df94bf6f4b9b15ef30b4","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    \"delete_network\": \"rule:admin_or_owner\","},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    \"create_port\": \"\","},{"line_number":51,"context_line":"    \"create_port:mac_address\": \"rule:admin_or_network_or_advsvc_owner\","},{"line_number":52,"context_line":"    \"create_port:fixed_ips\": \"rule:admin_or_network_or_advsvc_owner\","},{"line_number":53,"context_line":"    \"create_port:port_security_enabled\": \"rule:admin_or_network_or_advsvc_owner\","},{"line_number":54,"context_line":"    \"create_port:binding:host_id\": \"rule:admin_only\","}],"source_content_type":"application/json","patch_set":3,"id":"1ae5cdf2_c222f2a2","line":51,"in_reply_to":"1ae5cdf2_7beaeda0","updated":"2014-06-24 02:35:52.000000000","message":"Done","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df4290aed0d573575f45c5a8d1d79d46b71f156b","unresolved":false,"context_lines":[{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"context_is_advsvc\":  \"role:advsvc\","},{"line_number":4,"context_line":"    \"admin_or_network_owner\": \"rule:context_is_admin or tenant_id:%(network:tenant_id)s\","},{"line_number":5,"context_line":"    \"admin_or_owner\": \"rule:context_is_admin or tenant_id:%(tenant_id)s\","},{"line_number":6,"context_line":"    \"admin_only\": \"rule:context_is_admin\","},{"line_number":7,"context_line":"    \"regular_user\": \"\","},{"line_number":8,"context_line":"    \"shared\": \"field:networks:shared\u003dTrue\","}],"source_content_type":"application/json","patch_set":6,"id":"baada198_b6474f76","line":5,"updated":"2014-07-04 22:49:00.000000000","message":"moving this line is unnecessary but that\u0027s ok","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"723703b465c7d26dd0df68a33d750dc7d6801e58","unresolved":false,"context_lines":[{"line_number":2,"context_line":"    \"context_is_admin\":  \"role:admin\","},{"line_number":3,"context_line":"    \"context_is_advsvc\":  \"role:advsvc\","},{"line_number":4,"context_line":"    \"admin_or_network_owner\": \"rule:context_is_admin or tenant_id:%(network:tenant_id)s\","},{"line_number":5,"context_line":"    \"admin_or_owner\": \"rule:context_is_admin or tenant_id:%(tenant_id)s\","},{"line_number":6,"context_line":"    \"admin_only\": \"rule:context_is_admin\","},{"line_number":7,"context_line":"    \"regular_user\": \"\","},{"line_number":8,"context_line":"    \"shared\": \"field:networks:shared\u003dTrue\","}],"source_content_type":"application/json","patch_set":6,"id":"baada198_ff447a74","line":5,"in_reply_to":"baada198_b6474f76","updated":"2014-08-01 03:59:31.000000000","message":"+1","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":162,"name":"Bob Melander","email":"bob.melander@gmail.com","username":"bob-melander"},"change_message_id":"072715346970057657f2694f399508504dd67f7d","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    \"get_port:queue_id\": \"rule:admin_only\","},{"line_number":54,"context_line":"    \"get_port:binding:vif_type\": \"rule:admin_only\","},{"line_number":55,"context_line":"    \"get_port:binding:vif_details\": \"rule:admin_only\","},{"line_number":56,"context_line":"    \"get_port:binding:host_id\": \"rule:admin_only\","},{"line_number":57,"context_line":"    \"get_port:binding:profile\": \"rule:admin_only\","},{"line_number":58,"context_line":"    \"update_port\": \"rule:admin_or_owner or rule:context_is_advsvc\","},{"line_number":59,"context_line":"    \"update_port:fixed_ips\": \"rule:admin_or_network_owner or rule:context_is_advsvc\","}],"source_content_type":"application/json","patch_set":6,"id":"baada198_23bd3c03","line":56,"updated":"2014-07-16 23:16:13.000000000","message":"For the implementation of services in CSR1kv VMs, we\u0027ve had a need of port binding information, specifically the host_id field. So it\u0027d be good if the advsvc role would allow read access to that information too.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":6437,"name":"Susanne Balle","email":"sleipnir012@gmail.com","username":"susanne-balle"},"change_message_id":"a0390890683b9e90e19d753b177cec58e4abe735","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    \"get_port:queue_id\": \"rule:admin_only\","},{"line_number":54,"context_line":"    \"get_port:binding:vif_type\": \"rule:admin_only\","},{"line_number":55,"context_line":"    \"get_port:binding:vif_details\": \"rule:admin_only\","},{"line_number":56,"context_line":"    \"get_port:binding:host_id\": \"rule:admin_only\","},{"line_number":57,"context_line":"    \"get_port:binding:profile\": \"rule:admin_only\","},{"line_number":58,"context_line":"    \"update_port\": \"rule:admin_or_owner or rule:context_is_advsvc\","},{"line_number":59,"context_line":"    \"update_port:fixed_ips\": \"rule:admin_or_network_owner or rule:context_is_advsvc\","}],"source_content_type":"application/json","patch_set":6,"id":"baada198_c3bc356f","line":56,"in_reply_to":"baada198_23bd3c03","updated":"2014-07-18 13:31:44.000000000","message":"Good input. Kyle and I are looking at improving the patch to address everybody\u0027s concern. Thanks Susanne","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"}],"neutron/context.py":[{"author":{"_account_id":10310,"name":"Mandeep Dhami","email":"dhami@noironetworks.com","username":"mandeepdhami"},"change_message_id":"69a7d53a84315d6767d5724d968905a6bb2c3eb7","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.roles \u003d roles or []"},{"line_number":69,"context_line":"        if self.is_admin is None:"},{"line_number":70,"context_line":"            self.is_admin \u003d (policy.check_is_admin(self) or"},{"line_number":71,"context_line":"                             policy.check_is_advsvc(self))"},{"line_number":72,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":73,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":74,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_cc43563d","line":71,"updated":"2014-06-19 21:48:44.000000000","message":"Don\u0027t you need a different attribute \"is_advsvc\" or something like that? If we don\u0027t need to distinguish between an admin and advvsvc, we could have just used the admin role for advsvc actions and not create this extra role.","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"a6fef0db7f8e4081eb72df94bf6f4b9b15ef30b4","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.roles \u003d roles or []"},{"line_number":69,"context_line":"        if self.is_admin is None:"},{"line_number":70,"context_line":"            self.is_admin \u003d (policy.check_is_admin(self) or"},{"line_number":71,"context_line":"                             policy.check_is_advsvc(self))"},{"line_number":72,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":73,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":74,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_a25406ff","line":71,"in_reply_to":"1ae5cdf2_5b4611c1","updated":"2014-06-24 02:35:52.000000000","message":"The reason is that we want to be admin so we can view tenant networks, and also create/get/update/delete ports on tenant networks.","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"abffabe880377b093b820a7126f4511ef7620701","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.roles \u003d roles or []"},{"line_number":69,"context_line":"        if self.is_admin is None:"},{"line_number":70,"context_line":"            self.is_admin \u003d (policy.check_is_admin(self) or"},{"line_number":71,"context_line":"                             policy.check_is_advsvc(self))"},{"line_number":72,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":73,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":74,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_5b4611c1","line":71,"in_reply_to":"1ae5cdf2_62cb2b53","updated":"2014-06-20 07:56:56.000000000","message":"this casts a big question mark on my face.\nBeing adv svc user is then regarded as being admin as far as the context is concerned. I\u0027m not saying it\u0027s wrong, but why?","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d096828e1433e3d6a089113cd21f7d2b7919282c","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        self.roles \u003d roles or []"},{"line_number":69,"context_line":"        if self.is_admin is None:"},{"line_number":70,"context_line":"            self.is_admin \u003d (policy.check_is_admin(self) or"},{"line_number":71,"context_line":"                             policy.check_is_advsvc(self))"},{"line_number":72,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":73,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":74,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_62cb2b53","line":71,"in_reply_to":"1ae5cdf2_cc43563d","updated":"2014-06-19 23:50:52.000000000","message":"The idea here is to enable setting up the \"advsvc\" role, which allows for users with that role to gain \"admin\" for certain operations. Think of it as an elevated role.","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"cbeddef6bbe4d129b66b03768ea667a3e513d0b8","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self._session \u003d None"},{"line_number":68,"context_line":"        self.roles \u003d roles or []"},{"line_number":69,"context_line":"        if self.is_admin is None:"},{"line_number":70,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":71,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":72,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":73,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_0524c8b0","line":70,"updated":"2014-06-24 09:06:53.000000000","message":"Does it imply users with advsvc rule implicitly have admin rights ? ie: a user with advsvc rule can delete a resource belonging to an other tenant ?","commit_id":"2144050b0c7b150e8f121bc149a49b99b607c037"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"0ac47029d76807cc165c804385155da2460964ad","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self._session \u003d None"},{"line_number":68,"context_line":"        self.roles \u003d roles or []"},{"line_number":69,"context_line":"        if self.is_admin is None:"},{"line_number":70,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":71,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":72,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":73,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_cea4b84d","line":70,"in_reply_to":"1ae5cdf2_0524c8b0","updated":"2014-06-24 12:54:06.000000000","message":"It does, yes. But the policy file will only allow this role for certain resources by default. The requirement is to allow for this advsvc user to get a list of tenant networks, as well as create/get/update/delete ports on tenant networks.","commit_id":"2144050b0c7b150e8f121bc149a49b99b607c037"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"df4290aed0d573575f45c5a8d1d79d46b71f156b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_f62387ba","line":68,"updated":"2014-07-04 22:49:00.000000000","message":"this is what bothers me - basically this elevates a service user to have rights equal to those of admins in many situations.\n\nNow it is also true that pretty much a service user has the same rights of an admin, at least reading the commit message.\n\nHowever I think, for instance, it should not be allowed to delete arbitrary ports on other tenant\u0027s networks, but only the ports it created.\n\nThis will however pose additional challenges as we\u0027ll end up facing roablocks due to what at the end of the day is still authZ logic baked in the db class.\nAn example here: \nhttps://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L1538\n\nTaking all these DB level checks which restrict queries according to authZ right and making them generic enough to be able to satisfy the needs of different personas is something that goes way beyond the scope of this patch.\n\nI therefore think we have two options:\n1 - we agree to let service users running with admin credentials until we sorted all authZ bits baked in the DB logic\n2 - within this patch we make the db logic aware of service users using the clause context.is_admin or context.is_svc_user where appropriate","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":10310,"name":"Mandeep Dhami","email":"dhami@noironetworks.com","username":"mandeepdhami"},"change_message_id":"1bb999565fd0cb320e5d5a3a033be371010480c8","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5014bbf4","line":68,"in_reply_to":"baada198_0e0f9be2","updated":"2014-07-09 17:24:07.000000000","message":"I had the exact same question on patch set 3, and I still do not see any distinction between the roles. I understand the motivation that Susanne has for this role, but I do not see the difference as the code above explicitly says is_admin \u003d\u003d is_admin_or_advsvc","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":6437,"name":"Susanne Balle","email":"sleipnir012@gmail.com","username":"susanne-balle"},"change_message_id":"78ee693a9c6c3387cc167faa03e9538ba0b0669f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_83636840","line":68,"in_reply_to":"baada198_0e0f9be2","updated":"2014-07-09 20:44:20.000000000","message":"So the advsvc role only allows you to do actions on ports (create/update/deleet) as well as see all the networks.\n\nAs a global admin you can do more than that. When we tested this the advsvc role we tested and made sure the tenant with a role advsvc couldn\u0027t create or delete networks.\n\nTo me the advsrv doesn\u0027t equal global neutron admin.\n\nAm I missing something?\n\nSusanne","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"723703b465c7d26dd0df68a33d750dc7d6801e58","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_da542400","line":68,"in_reply_to":"baada198_77e875e2","updated":"2014-08-01 03:59:31.000000000","message":"I\u0027m hearing (1) that we need a new role because we don\u0027t want to trust this user as an admin.  I\u0027m also hearing that (2)  the service tenant is TRUSTED.  These two seem to conflict.\n\nIf (2) then what does this patch add?  Am I missing something?","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"343840005824aa24d7125f2d53f6559d3d289965","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_77e875e2","line":68,"in_reply_to":"baada198_83636840","updated":"2014-07-11 18:25:46.000000000","message":"Susanne, exactly this change should grant to users with advsvc role admin role (only) on port management (some sort of sudo).","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"f669d189c405d452df1c93eaa7445835a2d6218d","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_6697b739","line":68,"in_reply_to":"baada198_9198951b","updated":"2014-08-11 16:24:42.000000000","message":"I understand and agree with the desire to avoid granting power that should not be needed.  My comments were not meant to say that this work has no purpose.  I was merely trying to point out that there seems to be two contradicting arguments being used to argue 1) that we really need this separate user so we don\u0027t use neutron admin and 2) that this user doesn\u0027t need scrutiny.\n\nBasically, I support Salvatore\u0027s feedback and would like to see it addressed between the patch owners and him.  That is all.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4af24f19756e980f64a0a4df9e962c4231e440db","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0e0f9be2","line":68,"in_reply_to":"baada198_bd61ceaa","updated":"2014-07-09 08:08:03.000000000","message":"I am ok with this. But maybe let\u0027s just say for the time being a service user is an administrator.\n\ncreating a service role like this to me does not serve any purpose, mostly because I can\u0027t find any distinction between an admin and a service user.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":6437,"name":"Susanne Balle","email":"sleipnir012@gmail.com","username":"susanne-balle"},"change_message_id":"b39c2111948ec0ec3e6cb96954ba4b08c1808427","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_9198951b","line":68,"in_reply_to":"baada198_da542400","updated":"2014-08-11 09:37:35.000000000","message":"To us it is all around allowing tenant to only do what they should be able to do and not give them super powers when not needed.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"a7c776b6bbee86434db9c561ff1d02fd31054a43","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_3644181a","line":68,"in_reply_to":"baada198_f62387ba","updated":"2014-07-06 03:08:38.000000000","message":"I\u0027ll take a crack at option #2 after the mid-cycle and see how far I can get with that one.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":6437,"name":"Susanne Balle","email":"sleipnir012@gmail.com","username":"susanne-balle"},"change_message_id":"0fb352444f90ed4feba207ec7306938a681610b1","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self._session \u003d None"},{"line_number":66,"context_line":"        self.roles \u003d roles or []"},{"line_number":67,"context_line":"        if self.is_admin is None:"},{"line_number":68,"context_line":"            self.is_admin \u003d policy.check_is_admin_or_advsvc(self)"},{"line_number":69,"context_line":"        elif self.is_admin and load_admin_roles:"},{"line_number":70,"context_line":"            # Ensure context is populated with admin roles"},{"line_number":71,"context_line":"            admin_roles \u003d policy.get_admin_roles()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_bd61ceaa","line":68,"in_reply_to":"baada198_f62387ba","updated":"2014-07-07 13:53:14.000000000","message":"You have to remember that the service tenant is a TRUSTED tenant. The operator is setting the service tenant up in keystone with the advsrv role. \n\nTo me a lot of the things that bother you are related to the \"discretionary sharing\" use case where a tenant can share its network with other random tenants which should be treated in a different BP.\n\nGiven that we currently have to setup our service tenants as global Neutron admin to work around this limitation I see this fix as an improvement over what is there today. Also because service tenants are TRUSTED tenants I do not agree with you that it needs as much scrutiny as you indicate.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"}],"neutron/db/common_db_mixin.py":[{"author":{"_account_id":6502,"name":"Andrey Epifanov","email":"aepifanov@mirantis.com","username":"aepifanov"},"change_message_id":"f9de03936c31431b1ff4e20759880ed6628f3bb2","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # define basic filter condition for model query"},{"line_number":76,"context_line":"        # NOTE(jkoelker) non-admin queries are scoped to their tenant_id"},{"line_number":77,"context_line":"        # NOTE(salvatore-orlando): unless the model allows for shared objects"},{"line_number":78,"context_line":"        # NOTE(mestery): Or the the user has the advsvc role"},{"line_number":79,"context_line":"        query_filter \u003d None"},{"line_number":80,"context_line":"        if ((not context.is_admin and hasattr(model, \u0027tenant_id\u0027)) and"},{"line_number":81,"context_line":"            (not context.is_advsvc and hasattr(model, \u0027tenant_id\u0027))):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_2415b83f","line":78,"updated":"2014-10-17 11:43:10.000000000","message":"Extra article (the)","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"78aa67f5c6ef431a5c9bce642270751464cfc74f","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # define basic filter condition for model query"},{"line_number":76,"context_line":"        # NOTE(jkoelker) non-admin queries are scoped to their tenant_id"},{"line_number":77,"context_line":"        # NOTE(salvatore-orlando): unless the model allows for shared objects"},{"line_number":78,"context_line":"        # NOTE(mestery): Or the the user has the advsvc role"},{"line_number":79,"context_line":"        query_filter \u003d None"},{"line_number":80,"context_line":"        if ((not context.is_admin and hasattr(model, \u0027tenant_id\u0027)) and"},{"line_number":81,"context_line":"            (not context.is_advsvc and hasattr(model, \u0027tenant_id\u0027))):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_7474cbce","line":78,"in_reply_to":"baa201ad_2415b83f","updated":"2014-10-17 15:12:45.000000000","message":"Done","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"cd8ebd44bd888ad8719ac0301ec5dd1b91f421de","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    def model_query_scope(self, context, model):"},{"line_number":74,"context_line":"        # NOTE(jkoelker) non-admin queries are scoped to their tenant_id"},{"line_number":75,"context_line":"        # NOTE(salvatore-orlando): unless the model allows for shared objects"},{"line_number":76,"context_line":"        # NOTE(mestery): Or the user has the advsvc role"},{"line_number":77,"context_line":"        return ((not context.is_admin and hasattr(model, \u0027tenant_id\u0027)) and"},{"line_number":78,"context_line":"                (not context.is_advsvc and hasattr(model, \u0027tenant_id\u0027)))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9aa7fdbe_391cf369","line":76,"updated":"2014-10-28 04:21:00.000000000","message":"You\u0027re finishing each other\u0027s sentences.  cute.","commit_id":"d4f00659eb18c6a5df2ce6d35202b0a4a9409f70"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"cd8ebd44bd888ad8719ac0301ec5dd1b91f421de","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # NOTE(salvatore-orlando): unless the model allows for shared objects"},{"line_number":76,"context_line":"        # NOTE(mestery): Or the user has the advsvc role"},{"line_number":77,"context_line":"        return ((not context.is_admin and hasattr(model, \u0027tenant_id\u0027)) and"},{"line_number":78,"context_line":"                (not context.is_advsvc and hasattr(model, \u0027tenant_id\u0027)))"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _model_query(self, context, model):"},{"line_number":81,"context_line":"        query \u003d context.session.query(model)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aa7fdbe_761bea80","line":78,"updated":"2014-10-28 04:21:00.000000000","message":"nit:  Seems like these lines could lose a few parentheses.","commit_id":"d4f00659eb18c6a5df2ce6d35202b0a4a9409f70"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2e66d1b2ce828931c63f4a732d9cb35f3e1e13af","unresolved":false,"context_lines":[{"line_number":75,"context_line":"        # NOTE(salvatore-orlando): unless the model allows for shared objects"},{"line_number":76,"context_line":"        # NOTE(mestery): Or the user has the advsvc role"},{"line_number":77,"context_line":"        return ((not context.is_admin and hasattr(model, \u0027tenant_id\u0027)) and"},{"line_number":78,"context_line":"                (not context.is_advsvc and hasattr(model, \u0027tenant_id\u0027)))"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    def _model_query(self, context, model):"},{"line_number":81,"context_line":"        query \u003d context.session.query(model)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aa7fdbe_d07e5169","line":78,"in_reply_to":"9aa7fdbe_761bea80","updated":"2014-10-28 17:19:59.000000000","message":"nit too: Honestly I prefer to:\n\n  if ((not context.is_admin or not context.is_advsvc) and\n       hasattr(model, \u0027tenant_id\u0027)):\n\nbecause is_admin and is_advsvc contexts can access all resources.\n\nIt may be better to define a new method in context.py.","commit_id":"d4f00659eb18c6a5df2ce6d35202b0a4a9409f70"}],"neutron/db/external_net_db.py":[{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"3b01ad06fa984620ead840476b4b2ee79c5af8d4","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # Apply the external network filter only in non-admin and non-advsvc"},{"line_number":61,"context_line":"        # context"},{"line_number":62,"context_line":"        if ((not context.is_admin and hasattr(original_model, \u0027tenant_id\u0027))"},{"line_number":63,"context_line":"            and (not context.is_advsvc and hasattr(original_model,"},{"line_number":64,"context_line":"                                                   \u0027tenant_id\u0027))):"},{"line_number":65,"context_line":"            conditions \u003d expr.or_(ExternalNetwork.network_id !\u003d expr.null(),"},{"line_number":66,"context_line":"                                  *conditions)"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_9e155a9d","line":63,"updated":"2014-10-13 13:03:27.000000000","message":"this also appears in neutron/db/common_db_mixin.py - could it move out into a common method (probably in common_db_mixin) ?","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"78aa67f5c6ef431a5c9bce642270751464cfc74f","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # Apply the external network filter only in non-admin and non-advsvc"},{"line_number":61,"context_line":"        # context"},{"line_number":62,"context_line":"        if ((not context.is_admin and hasattr(original_model, \u0027tenant_id\u0027))"},{"line_number":63,"context_line":"            and (not context.is_advsvc and hasattr(original_model,"},{"line_number":64,"context_line":"                                                   \u0027tenant_id\u0027))):"},{"line_number":65,"context_line":"            conditions \u003d expr.or_(ExternalNetwork.network_id !\u003d expr.null(),"},{"line_number":66,"context_line":"                                  *conditions)"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_0ab51a7d","line":63,"in_reply_to":"baa201ad_44206749","updated":"2014-10-17 15:12:45.000000000","message":"Seems reasonable, I\u0027ll see about adding this into the patch.","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"de6e989ca76a81879f0fee00a54b15848614d08f","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # Apply the external network filter only in non-admin and non-advsvc"},{"line_number":61,"context_line":"        # context"},{"line_number":62,"context_line":"        if ((not context.is_admin and hasattr(original_model, \u0027tenant_id\u0027))"},{"line_number":63,"context_line":"            and (not context.is_advsvc and hasattr(original_model,"},{"line_number":64,"context_line":"                                                   \u0027tenant_id\u0027))):"},{"line_number":65,"context_line":"            conditions \u003d expr.or_(ExternalNetwork.network_id !\u003d expr.null(),"},{"line_number":66,"context_line":"                                  *conditions)"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_44206749","line":63,"in_reply_to":"baa201ad_9e155a9d","updated":"2014-10-14 09:25:44.000000000","message":"+1","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"}],"neutron/openstack/common/context.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"de6e989ca76a81879f0fee00a54b15848614d08f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.user \u003d user"},{"line_number":47,"context_line":"        self.tenant \u003d tenant"},{"line_number":48,"context_line":"        self.is_admin \u003d is_admin"},{"line_number":49,"context_line":"        self.is_advsvc \u003d is_advsvc"},{"line_number":50,"context_line":"        self.read_only \u003d read_only"},{"line_number":51,"context_line":"        self.show_deleted \u003d show_deleted"},{"line_number":52,"context_line":"        if not request_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_c41297b3","line":49,"updated":"2014-10-14 09:25:44.000000000","message":"Probably we\u0027d like to add also the type of advanced service later.\nAnd then list networks/ports of a given service.\nBut it would be another discussion.","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"78aa67f5c6ef431a5c9bce642270751464cfc74f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.user \u003d user"},{"line_number":47,"context_line":"        self.tenant \u003d tenant"},{"line_number":48,"context_line":"        self.is_admin \u003d is_admin"},{"line_number":49,"context_line":"        self.is_advsvc \u003d is_advsvc"},{"line_number":50,"context_line":"        self.read_only \u003d read_only"},{"line_number":51,"context_line":"        self.show_deleted \u003d show_deleted"},{"line_number":52,"context_line":"        if not request_id:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_b451d331","line":49,"in_reply_to":"baa201ad_c41297b3","updated":"2014-10-17 15:12:45.000000000","message":"Agreed, that can be done as a followup patch.","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"}],"neutron/policy.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"b3b008963950814131baea9d8957b03d8db8e7ce","unresolved":false,"context_lines":[{"line_number":393,"context_line":"    credentials \u003d context.to_dict()"},{"line_number":394,"context_line":"    target \u003d credentials"},{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    ret \u003d policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":"    return ret"},{"line_number":399,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_86e2149e","line":396,"updated":"2014-06-19 18:41:38.000000000","message":"this ends up with ADVSVC_CTX_POLICY or False.\nis the latter intended?","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"75aaf2de6b50e82b20c85be1f567bbfeccc98bd0","unresolved":false,"context_lines":[{"line_number":393,"context_line":"    credentials \u003d context.to_dict()"},{"line_number":394,"context_line":"    target \u003d credentials"},{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    ret \u003d policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":"    return ret"},{"line_number":399,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_ea5705ff","line":396,"in_reply_to":"1ae5cdf2_69915951","updated":"2014-06-20 10:30:59.000000000","message":"- if it\u0027s in the rule, True and ADVSVC_CTX_POLICY -\u003e ADVSVC_CTX_POLICY.\n- if it isn\u0027t, False and ADVSVC_CTX_POLICY -\u003e False.\n\nin the latter case, passing False to policy.check seems awkward.","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d6227319eb0a1419c9020497efb9a95712db17ad","unresolved":false,"context_lines":[{"line_number":393,"context_line":"    credentials \u003d context.to_dict()"},{"line_number":394,"context_line":"    target \u003d credentials"},{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    ret \u003d policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":"    return ret"},{"line_number":399,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_69915951","line":396,"in_reply_to":"1ae5cdf2_86e2149e","updated":"2014-06-19 19:04:54.000000000","message":"How so? This is actually True if ADVSVC_CTX_POLICY is set in the policy rules?","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"b3b008963950814131baea9d8957b03d8db8e7ce","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    ret \u003d policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":"    return ret"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"def _extract_roles(rule, roles):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_8673f44c","line":398,"updated":"2014-06-19 18:41:38.000000000","message":"ret variable seems unnecessary","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d6227319eb0a1419c9020497efb9a95712db17ad","unresolved":false,"context_lines":[{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    ret \u003d policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":"    return ret"},{"line_number":399,"context_line":""},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"def _extract_roles(rule, roles):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_e9a569b5","line":398,"in_reply_to":"1ae5cdf2_8673f44c","updated":"2014-06-19 19:04:54.000000000","message":"Done","commit_id":"545017f19976d3c0194b5dae7b4954c1f2b9e424"},{"author":{"_account_id":490,"name":"Sumit Naiksatam","email":"sumitnaiksatam@gmail.com","username":"snaiksat"},"change_message_id":"4713ec1326367ce4f81f2f74f05051f72b714732","unresolved":false,"context_lines":[{"line_number":386,"context_line":"def check_is_advsvc(context):"},{"line_number":387,"context_line":"    \"\"\"Verify context has advsvc according to policy settings."},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    Setting this will allow the caller to enable admin mode."},{"line_number":390,"context_line":"    \"\"\""},{"line_number":391,"context_line":"    init()"},{"line_number":392,"context_line":"    # the target is user-self"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ac8b6fbe","line":389,"updated":"2014-06-19 19:43:34.000000000","message":"admin mode? or is it advsvc mode?","commit_id":"90f95a6284b48a4642bc60ae72cd3aac0b70bed7"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"3744248533b788935c8431cce773341cfaf47204","unresolved":false,"context_lines":[{"line_number":386,"context_line":"def check_is_advsvc(context):"},{"line_number":387,"context_line":"    \"\"\"Verify context has advsvc according to policy settings."},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"    Setting this will allow the caller to enable admin mode."},{"line_number":390,"context_line":"    \"\"\""},{"line_number":391,"context_line":"    init()"},{"line_number":392,"context_line":"    # the target is user-self"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_57def46d","line":389,"in_reply_to":"1ae5cdf2_ac8b6fbe","updated":"2014-06-19 19:51:02.000000000","message":"It effectively turns on admin mode by using the advsvc flag. Maybe the comment isn\u0027t clear enough, perhaps.","commit_id":"90f95a6284b48a4642bc60ae72cd3aac0b70bed7"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"abffabe880377b093b820a7126f4511ef7620701","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    target \u003d credentials"},{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    return policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"def _extract_roles(rule, roles):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_1b6e492f","line":397,"updated":"2014-06-20 07:56:56.000000000","message":"there is a lot of repetition among check_is_admin and check_is_advsvc. They can be merged I think - but please first answer the other comment on why being an adv svc user is regarded as being an admin.","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"a6fef0db7f8e4081eb72df94bf6f4b9b15ef30b4","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    target \u003d credentials"},{"line_number":395,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY in policy._rules"},{"line_number":396,"context_line":"                    and ADVSVC_CTX_POLICY)"},{"line_number":397,"context_line":"    return policy.check(advsvc_policy, target, credentials)"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"def _extract_roles(rule, roles):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_02f3fae7","line":397,"in_reply_to":"1ae5cdf2_1b6e492f","updated":"2014-06-24 02:35:52.000000000","message":"Collapsed.","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"cbeddef6bbe4d129b66b03768ea667a3e513d0b8","unresolved":false,"context_lines":[{"line_number":372,"context_line":"    return result"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"def check_is_admin_or_advsvc(context):"},{"line_number":376,"context_line":"    \"\"\"Verify context has admin rights according to policy settings."},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    Setting the advsvc role wil allow the caller to enable admin mode."}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_45db304f","line":375,"updated":"2014-06-24 09:06:53.000000000","message":"IMO, it seems a little bit hardcoded ... it seems like a sudo feature. I would prefer we define in policy.json under which conditions a user can have \"sudo\" rights and transform check_is_admin_or_advsvc into check_is_admin_or_can_sudo","commit_id":"2144050b0c7b150e8f121bc149a49b99b607c037"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"0ac47029d76807cc165c804385155da2460964ad","unresolved":false,"context_lines":[{"line_number":372,"context_line":"    return result"},{"line_number":373,"context_line":""},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"def check_is_admin_or_advsvc(context):"},{"line_number":376,"context_line":"    \"\"\"Verify context has admin rights according to policy settings."},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"    Setting the advsvc role wil allow the caller to enable admin mode."}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_8e71d0e0","line":375,"in_reply_to":"1ae5cdf2_45db304f","updated":"2014-06-24 12:54:06.000000000","message":"We\u0027re just checking for admin or advsvc user here. When the policy framework is cleaned up a bit more, this can be taken into account in the future.","commit_id":"2144050b0c7b150e8f121bc149a49b99b607c037"},{"author":{"_account_id":10965,"name":"Magesh GV","email":"mageshgv@gmail.com","username":"mageshgv"},"change_message_id":"9fbb3742520fcf42d2f2ce998e3f4add95f716fc","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    # found, default to validating role:admin"},{"line_number":386,"context_line":"    admin_policy \u003d (ADMIN_CTX_POLICY in policy._rules"},{"line_number":387,"context_line":"                    and ADMIN_CTX_POLICY or"},{"line_number":388,"context_line":"                    ADVSVC_CTX_POLICY in policy._rules"},{"line_number":389,"context_line":"                    and ADVSVC_CTX_POLICY or \u0027role:admin\u0027)"},{"line_number":390,"context_line":"    return policy.check(admin_policy, target, credentials)"},{"line_number":391,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1ae5cdf2_dd37ec49","line":388,"updated":"2014-06-25 06:39:32.000000000","message":"Adding check for ADVSVC_CTX_POLICY here will not have any effect because ADMIN_CTX_POLICY will already be present in policy._rules which is loaded from the policy configuration file. So policy check will always fail for a non admin user which I assume is the actual use case here.","commit_id":"75bad243dadd02446482ef40c543754164b22dc9"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"b710228ac81c8f9415a75747915554b6a508dd9b","unresolved":false,"context_lines":[{"line_number":385,"context_line":"    # found, default to validating role:admin"},{"line_number":386,"context_line":"    admin_policy \u003d (ADMIN_CTX_POLICY in policy._rules"},{"line_number":387,"context_line":"                    and ADMIN_CTX_POLICY or"},{"line_number":388,"context_line":"                    ADVSVC_CTX_POLICY in policy._rules"},{"line_number":389,"context_line":"                    and ADVSVC_CTX_POLICY or \u0027role:admin\u0027)"},{"line_number":390,"context_line":"    return policy.check(admin_policy, target, credentials)"},{"line_number":391,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1ae5cdf2_1130ef9c","line":388,"in_reply_to":"1ae5cdf2_dd37ec49","updated":"2014-06-27 19:28:51.000000000","message":"I don\u0027t follow this. \"context_is_advsvc\" will be set to \"role:advsvc\", not admin. So how will ADMIN always be set?","commit_id":"75bad243dadd02446482ef40c543754164b22dc9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"723703b465c7d26dd0df68a33d750dc7d6801e58","unresolved":false,"context_lines":[{"line_number":379,"context_line":"    # the target is user-self"},{"line_number":380,"context_line":"    credentials \u003d context.to_dict()"},{"line_number":381,"context_line":"    target \u003d credentials"},{"line_number":382,"context_line":"    # Backward compatibility: if ADMIN_CTX_POLICY is not"},{"line_number":383,"context_line":"    # found, default to validating role:admin"},{"line_number":384,"context_line":"    admin_policy \u003d (ADMIN_CTX_POLICY in policy._rules"},{"line_number":385,"context_line":"                    and ADMIN_CTX_POLICY or"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_44fafd44","line":382,"updated":"2014-08-01 03:59:31.000000000","message":"nit:  This comment is slightly off now with this change.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"723703b465c7d26dd0df68a33d750dc7d6801e58","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    # found, default to validating role:admin"},{"line_number":384,"context_line":"    admin_policy \u003d (ADMIN_CTX_POLICY in policy._rules"},{"line_number":385,"context_line":"                    and ADMIN_CTX_POLICY or"},{"line_number":386,"context_line":"                    ADVSVC_CTX_POLICY in policy._rules"},{"line_number":387,"context_line":"                    and ADVSVC_CTX_POLICY or \u0027role:admin\u0027)"},{"line_number":388,"context_line":"    return policy.check(admin_policy, target, credentials)"},{"line_number":389,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_e81f6358","line":386,"updated":"2014-08-01 03:59:31.000000000","message":"I\u0027m not sure I understand so please help me.  Here \"policy\" is a global thing imported from common.  It doesn\u0027t seem to be specific to this policy check.  So, I don\u0027t understand the scenario where \"ADMIN_CTX_POLICY in policy._rules\" is False allowing a fallback to checking \"ADVSVC_CTX_POLICY in policy._rules\"\n\nI\u0027m probably missing something and I probably don\u0027t fully understand how policy checking works.","commit_id":"b084a5b11ae6e2a02889a21c3d2bcb0ff2f03311"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"de6e989ca76a81879f0fee00a54b15848614d08f","unresolved":false,"context_lines":[{"line_number":425,"context_line":"    target \u003d credentials"},{"line_number":426,"context_line":"    # Backward compatibility: if ADVSVC_CTX_POLICY is not"},{"line_number":427,"context_line":"    # found, default to validating role:advsvc"},{"line_number":428,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY or ADVSVC_CTX_POLICY in policy._rules"},{"line_number":429,"context_line":"                    and ADVSVC_CTX_POLICY or \u0027role:advsvc\u0027)"},{"line_number":430,"context_line":"    return policy.check(advsvc_policy, target, credentials)"},{"line_number":431,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_84032fb7","line":428,"updated":"2014-10-14 09:25:44.000000000","message":"The first \"ADVSVC_CTC_POLICY or\" isn\u0027t needed because it\u0027s always true due to line 42.\n\nAlthough it\u0027s a matter of taste, how about adding redundant parens to explicitly show the precedence of \"and\" \"or\" operator?","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"78aa67f5c6ef431a5c9bce642270751464cfc74f","unresolved":false,"context_lines":[{"line_number":425,"context_line":"    target \u003d credentials"},{"line_number":426,"context_line":"    # Backward compatibility: if ADVSVC_CTX_POLICY is not"},{"line_number":427,"context_line":"    # found, default to validating role:advsvc"},{"line_number":428,"context_line":"    advsvc_policy \u003d (ADVSVC_CTX_POLICY or ADVSVC_CTX_POLICY in policy._rules"},{"line_number":429,"context_line":"                    and ADVSVC_CTX_POLICY or \u0027role:advsvc\u0027)"},{"line_number":430,"context_line":"    return policy.check(advsvc_policy, target, credentials)"},{"line_number":431,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_078193fa","line":428,"in_reply_to":"baa201ad_84032fb7","updated":"2014-10-17 15:12:45.000000000","message":"Agree on the first point, on the second point, I\u0027ll leave it as is, as it\u0027s personal taste. :)","commit_id":"eb17bfb5c001d2dc8d10e69738c0aaf787fd6e4b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6ca851d5c2279e913714070e8c3958ffbc5a84b1","unresolved":false,"context_lines":[{"line_number":417,"context_line":"    return policy.check(admin_policy, target, credentials)"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"def check_is_advsvc(context):"},{"line_number":421,"context_line":"    \"\"\"Verify context has advsvc rights according to policy settings.\"\"\""},{"line_number":422,"context_line":"    init()"},{"line_number":423,"context_line":"    # the target is user-self"}],"source_content_type":"text/x-python","patch_set":8,"id":"baa201ad_40b1c145","line":420,"updated":"2014-10-17 15:49:51.000000000","message":"This function is pretty the same as check_is_admin. How about reducing code duplication a bit?","commit_id":"412381533d83f1ea7cd4a46035df08a52f7cae48"}],"neutron/tests/unit/test_policy.py":[{"author":{"_account_id":10310,"name":"Mandeep Dhami","email":"dhami@noironetworks.com","username":"mandeepdhami"},"change_message_id":"69a7d53a84315d6767d5724d968905a6bb2c3eb7","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        self.rules \u003d dict((k, common_policy.parse_rule(v)) for k, v in {"},{"line_number":234,"context_line":"            \"context_is_admin\": \"role:admin\","},{"line_number":235,"context_line":"            \"context_is_advsvc\": \"role:advsvc\","},{"line_number":236,"context_line":"            \"admin_or_network_owner\": \"rule:context_is_admin or \""},{"line_number":237,"context_line":"                                      \"tenant_id:%(network:tenant_id)s\","},{"line_number":238,"context_line":"            \"admin_or_network_owner_or_advsvc\": \"rule:context_is_admin or \""},{"line_number":239,"context_line":"                                                \"tenant_id:%(network:\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_585f0141","line":236,"updated":"2014-06-19 21:48:44.000000000","message":"Lines 236-237 are repeated below (lines 245-246)","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"d096828e1433e3d6a089113cd21f7d2b7919282c","unresolved":false,"context_lines":[{"line_number":233,"context_line":"        self.rules \u003d dict((k, common_policy.parse_rule(v)) for k, v in {"},{"line_number":234,"context_line":"            \"context_is_admin\": \"role:admin\","},{"line_number":235,"context_line":"            \"context_is_advsvc\": \"role:advsvc\","},{"line_number":236,"context_line":"            \"admin_or_network_owner\": \"rule:context_is_admin or \""},{"line_number":237,"context_line":"                                      \"tenant_id:%(network:tenant_id)s\","},{"line_number":238,"context_line":"            \"admin_or_network_owner_or_advsvc\": \"rule:context_is_admin or \""},{"line_number":239,"context_line":"                                                \"tenant_id:%(network:\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_c2bcffb7","line":236,"in_reply_to":"1ae5cdf2_585f0141","updated":"2014-06-19 23:50:52.000000000","message":"Done","commit_id":"8b1a314d073cd7549ed42831fd33069a8d6d74f6"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"607729b9ea575d380ee848f2af1184dc96739297","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        self._test_advsvc_action_on_attr(\u0027create\u0027, \u0027network\u0027, \u0027shared\u0027, False,"},{"line_number":326,"context_line":"                                         exceptions.PolicyNotAuthorized)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def test_advsvc_get_port_works(self):"},{"line_number":329,"context_line":"        self._test_advsvc_action_on_attr(\u0027get\u0027, \u0027port\u0027, \u0027shared\u0027, False)"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    def test_advsvc_update_port_works(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ae5cdf2_c3f54552","line":328,"updated":"2014-06-25 12:43:16.000000000","message":"what about testing creating a port?","commit_id":"75bad243dadd02446482ef40c543754164b22dc9"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"b710228ac81c8f9415a75747915554b6a508dd9b","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        self._test_advsvc_action_on_attr(\u0027create\u0027, \u0027network\u0027, \u0027shared\u0027, False,"},{"line_number":326,"context_line":"                                         exceptions.PolicyNotAuthorized)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    def test_advsvc_get_port_works(self):"},{"line_number":329,"context_line":"        self._test_advsvc_action_on_attr(\u0027get\u0027, \u0027port\u0027, \u0027shared\u0027, False)"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    def test_advsvc_update_port_works(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1ae5cdf2_052fd1f6","line":328,"in_reply_to":"1ae5cdf2_c3f54552","updated":"2014-06-27 19:28:51.000000000","message":"Done","commit_id":"75bad243dadd02446482ef40c543754164b22dc9"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"78afbff433e97236238504abd0edbf252811c65d","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        policy.reset()"},{"line_number":41,"context_line":"        self.addCleanup(policy.reset)"},{"line_number":42,"context_line":"        self.context \u003d context.Context(\u0027fake\u0027, \u0027fake\u0027, is_admin\u003dFalse)"},{"line_number":43,"context_line":"        #self.target \u003d {}"},{"line_number":44,"context_line":"        self.target \u003d {\u0027tenant_id\u0027: \u0027fake\u0027}"},{"line_number":45,"context_line":"        self.tempdir \u003d self.useFixture(fixtures.TempDir())"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_a4902a44","line":43,"updated":"2014-10-22 21:54:35.000000000","message":"Left a comment?","commit_id":"7620e1b41fc56313325a551160d98b63374f6274"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b40e0a8617e4f60a943774e92fe2e0ac2bc51efc","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        policy.reset()"},{"line_number":41,"context_line":"        self.addCleanup(policy.reset)"},{"line_number":42,"context_line":"        self.context \u003d context.Context(\u0027fake\u0027, \u0027fake\u0027, is_admin\u003dFalse)"},{"line_number":43,"context_line":"        #self.target \u003d {}"},{"line_number":44,"context_line":"        self.target \u003d {\u0027tenant_id\u0027: \u0027fake\u0027}"},{"line_number":45,"context_line":"        self.tempdir \u003d self.useFixture(fixtures.TempDir())"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_b5455144","line":43,"in_reply_to":"9aa7fdbe_a4902a44","updated":"2014-10-27 19:25:18.000000000","message":"good find. This should go.","commit_id":"7620e1b41fc56313325a551160d98b63374f6274"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"b3281ea34023339be9cd6543ec192f058ae8ebf3","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        policy.reset()"},{"line_number":41,"context_line":"        self.addCleanup(policy.reset)"},{"line_number":42,"context_line":"        self.context \u003d context.Context(\u0027fake\u0027, \u0027fake\u0027, is_admin\u003dFalse)"},{"line_number":43,"context_line":"        #self.target \u003d {}"},{"line_number":44,"context_line":"        self.target \u003d {\u0027tenant_id\u0027: \u0027fake\u0027}"},{"line_number":45,"context_line":"        self.tempdir \u003d self.useFixture(fixtures.TempDir())"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_95c3ed36","line":43,"in_reply_to":"9aa7fdbe_b5455144","updated":"2014-10-27 19:51:55.000000000","message":"Done","commit_id":"7620e1b41fc56313325a551160d98b63374f6274"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"78afbff433e97236238504abd0edbf252811c65d","unresolved":false,"context_lines":[{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def _test_action_on_attr(self, context, action, obj, attr, value,"},{"line_number":291,"context_line":"                             exception\u003dNone, **kwargs):"},{"line_number":292,"context_line":"        action \u003d \"%s_%s\" % (action, obj)"},{"line_number":293,"context_line":"        target \u003d {\u0027tenant_id\u0027: \u0027the_owner\u0027, attr: value}"},{"line_number":294,"context_line":"        if kwargs:"},{"line_number":295,"context_line":"            target.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_84a9667d","line":292,"updated":"2014-10-22 21:54:35.000000000","message":"action \u003d \"\"{0}_{1}\".format(action, obj)\n\n%substitution isn\u0027t recommended anymore, I think.","commit_id":"7620e1b41fc56313325a551160d98b63374f6274"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"b40e0a8617e4f60a943774e92fe2e0ac2bc51efc","unresolved":false,"context_lines":[{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def _test_action_on_attr(self, context, action, obj, attr, value,"},{"line_number":291,"context_line":"                             exception\u003dNone, **kwargs):"},{"line_number":292,"context_line":"        action \u003d \"%s_%s\" % (action, obj)"},{"line_number":293,"context_line":"        target \u003d {\u0027tenant_id\u0027: \u0027the_owner\u0027, attr: value}"},{"line_number":294,"context_line":"        if kwargs:"},{"line_number":295,"context_line":"            target.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_954a0d53","line":292,"in_reply_to":"9aa7fdbe_13712ce0","updated":"2014-10-27 19:25:18.000000000","message":"regardless of what the python nomenklatura decides, we are using % substitutions everywhere in the code. I\u0027d rather keep using them than mixing both styles.\nUnless obviously we\u0027re mandated to move away from % substititutions.","commit_id":"7620e1b41fc56313325a551160d98b63374f6274"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e9427127ff137a81cf2d66ac8f75a9fc643a8d03","unresolved":false,"context_lines":[{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def _test_action_on_attr(self, context, action, obj, attr, value,"},{"line_number":291,"context_line":"                             exception\u003dNone, **kwargs):"},{"line_number":292,"context_line":"        action \u003d \"%s_%s\" % (action, obj)"},{"line_number":293,"context_line":"        target \u003d {\u0027tenant_id\u0027: \u0027the_owner\u0027, attr: value}"},{"line_number":294,"context_line":"        if kwargs:"},{"line_number":295,"context_line":"            target.update(kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_13712ce0","line":292,"in_reply_to":"9aa7fdbe_84a9667d","updated":"2014-10-23 11:42:19.000000000","message":"I mildly disagree. It\u0027s still not clear where Python community is going. Though the original idea was to get rid of % operator, recent moves show that % will stay (recent Python docs stopped talking about % as something obsolete, just recommend using .format() due to its wider list of features).","commit_id":"7620e1b41fc56313325a551160d98b63374f6274"}]}
