{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-cli/pulls/comments/73608624","id":73608624,"diff_hunk":"@@ -23,47 +29,241 @@ def _graph_client_factory(**_):\n     configure_common_settings(client)\n     return client\n \n+def list_role_definitions(name=None, resource_group_name=None, resource_id=None,\n+                          custom_role_only=False):\n+    definitions_client = _auth_client_factory().role_definitions\n+    scope = _build_role_scope(resource_group_name, resource_id,\n+                              definitions_client.config.subscription_id)\n+    return _search_role_definitions(definitions_client, name, scope, custom_role_only)\n+\n+def create_role_definition(role_definition):","path":"src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py","position":37,"original_position":37,"commit_id":"9142af4fa72826211fcb03af99a1fa878386f054","original_commit_id":"9142af4fa72826211fcb03af99a1fa878386f054","user":{"login":"tjprescott","id":5723682,"avatar_url":"https://avatars.githubusercontent.com/u/5723682?v=3","gravatar_id":"","url":"https://api.github.com/users/tjprescott","html_url":"https://github.com/tjprescott","followers_url":"https://api.github.com/users/tjprescott/followers","following_url":"https://api.github.com/users/tjprescott/following{/other_user}","gists_url":"https://api.github.com/users/tjprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/tjprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjprescott/subscriptions","organizations_url":"https://api.github.com/users/tjprescott/orgs","repos_url":"https://api.github.com/users/tjprescott/repos","events_url":"https://api.github.com/users/tjprescott/events{/privacy}","received_events_url":"https://api.github.com/users/tjprescott/received_events","type":"User","site_admin":false},"body":"After our discussion it seems like this can be achieved with multiple parameters. I would just add you might want to preserve a parameter to get the definition from the JSON file. \r\n\r\n---\r\nIn reply to: [73604232](https://github.com/Azure/azure-cli/pull/602#discussion_r73604232) [](ancestors = 73604232)","created_at":"2016-08-04T21:44:41Z","updated_at":"2016-08-04T21:44:41Z","html_url":"https://github.com/Azure/azure-cli/pull/602#discussion_r73608624","pull_request_url":"https://api.github.com/repos/Azure/azure-cli/pulls/602","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/comments/73608624"},"html":{"href":"https://github.com/Azure/azure-cli/pull/602#discussion_r73608624"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/602"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-cli/pulls/602","id":79941707,"html_url":"https://github.com/Azure/azure-cli/pull/602","diff_url":"https://github.com/Azure/azure-cli/pull/602.diff","patch_url":"https://github.com/Azure/azure-cli/pull/602.patch","issue_url":"https://api.github.com/repos/Azure/azure-cli/issues/602","number":602,"state":"open","locked":false,"title":"rbac: list & delete assignment; role definition create, list and delete","user":{"login":"yugangw-msft","id":6014209,"avatar_url":"https://avatars.githubusercontent.com/u/6014209?v=3","gravatar_id":"","url":"https://api.github.com/users/yugangw-msft","html_url":"https://github.com/yugangw-msft","followers_url":"https://api.github.com/users/yugangw-msft/followers","following_url":"https://api.github.com/users/yugangw-msft/following{/other_user}","gists_url":"https://api.github.com/users/yugangw-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/yugangw-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugangw-msft/subscriptions","organizations_url":"https://api.github.com/users/yugangw-msft/orgs","repos_url":"https://api.github.com/users/yugangw-msft/repos","events_url":"https://api.github.com/users/yugangw-msft/events{/privacy}","received_events_url":"https://api.github.com/users/yugangw-msft/received_events","type":"User","site_admin":false},"body":"Notes by comparing with node cli\r\n1.  Make `create`, `list`, `delete` consistent. By using the same filter, those 3 command will work on the same assignment. Node cli doesn't have this behavior, which is confusing\r\n2. Relieve users from the concept of `scope`, they just need to use either resource group, or resource id\r\n3. Expose the filters of `--all`, `--include-inherited` for people to opt-in to see extra assignments if they like\r\n4. For `delete`, i have not made up mind of whether to expose `--all` to delete all assignments. Feel it somehow risky operations. But feel free to comment.\r\n\r\n/CC:@derekbekoe, @burtbiel, @tjprescott , @jasonrshaver ","created_at":"2016-08-03T16:59:01Z","updated_at":"2016-08-04T21:44:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49eca187f7de6f78ad1a6ad2e5d01469eb25ecc7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-cli/pulls/602/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-cli/pulls/602/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-cli/issues/602/comments","statuses_url":"https://api.github.com/repos/Azure/azure-cli/statuses/9142af4fa72826211fcb03af99a1fa878386f054","head":{"label":"yugangw-msft:list","ref":"list","sha":"9142af4fa72826211fcb03af99a1fa878386f054","user":{"login":"yugangw-msft","id":6014209,"avatar_url":"https://avatars.githubusercontent.com/u/6014209?v=3","gravatar_id":"","url":"https://api.github.com/users/yugangw-msft","html_url":"https://github.com/yugangw-msft","followers_url":"https://api.github.com/users/yugangw-msft/followers","following_url":"https://api.github.com/users/yugangw-msft/following{/other_user}","gists_url":"https://api.github.com/users/yugangw-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/yugangw-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugangw-msft/subscriptions","organizations_url":"https://api.github.com/users/yugangw-msft/orgs","repos_url":"https://api.github.com/users/yugangw-msft/repos","events_url":"https://api.github.com/users/yugangw-msft/events{/privacy}","received_events_url":"https://api.github.com/users/yugangw-msft/received_events","type":"User","site_admin":false},"repo":{"id":64246644,"name":"azure-cli","full_name":"yugangw-msft/azure-cli","owner":{"login":"yugangw-msft","id":6014209,"avatar_url":"https://avatars.githubusercontent.com/u/6014209?v=3","gravatar_id":"","url":"https://api.github.com/users/yugangw-msft","html_url":"https://github.com/yugangw-msft","followers_url":"https://api.github.com/users/yugangw-msft/followers","following_url":"https://api.github.com/users/yugangw-msft/following{/other_user}","gists_url":"https://api.github.com/users/yugangw-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/yugangw-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugangw-msft/subscriptions","organizations_url":"https://api.github.com/users/yugangw-msft/orgs","repos_url":"https://api.github.com/users/yugangw-msft/repos","events_url":"https://api.github.com/users/yugangw-msft/events{/privacy}","received_events_url":"https://api.github.com/users/yugangw-msft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yugangw-msft/azure-cli","description":"Command-line tools for Azure.","fork":true,"url":"https://api.github.com/repos/yugangw-msft/azure-cli","forks_url":"https://api.github.com/repos/yugangw-msft/azure-cli/forks","keys_url":"https://api.github.com/repos/yugangw-msft/azure-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yugangw-msft/azure-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yugangw-msft/azure-cli/teams","hooks_url":"https://api.github.com/repos/yugangw-msft/azure-cli/hooks","issue_events_url":"https://api.github.com/repos/yugangw-msft/azure-cli/issues/events{/number}","events_url":"https://api.github.com/repos/yugangw-msft/azure-cli/events","assignees_url":"https://api.github.com/repos/yugangw-msft/azure-cli/assignees{/user}","branches_url":"https://api.github.com/repos/yugangw-msft/azure-cli/branches{/branch}","tags_url":"https://api.github.com/repos/yugangw-msft/azure-cli/tags","blobs_url":"https://api.github.com/repos/yugangw-msft/azure-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yugangw-msft/azure-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yugangw-msft/azure-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/yugangw-msft/azure-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yugangw-msft/azure-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/yugangw-msft/azure-cli/languages","stargazers_url":"https://api.github.com/repos/yugangw-msft/azure-cli/stargazers","contributors_url":"https://api.github.com/repos/yugangw-msft/azure-cli/contributors","subscribers_url":"https://api.github.com/repos/yugangw-msft/azure-cli/subscribers","subscription_url":"https://api.github.com/repos/yugangw-msft/azure-cli/subscription","commits_url":"https://api.github.com/repos/yugangw-msft/azure-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/yugangw-msft/azure-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/yugangw-msft/azure-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/yugangw-msft/azure-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/yugangw-msft/azure-cli/contents/{+path}","compare_url":"https://api.github.com/repos/yugangw-msft/azure-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yugangw-msft/azure-cli/merges","archive_url":"https://api.github.com/repos/yugangw-msft/azure-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yugangw-msft/azure-cli/downloads","issues_url":"https://api.github.com/repos/yugangw-msft/azure-cli/issues{/number}","pulls_url":"https://api.github.com/repos/yugangw-msft/azure-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/yugangw-msft/azure-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/yugangw-msft/azure-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yugangw-msft/azure-cli/labels{/name}","releases_url":"https://api.github.com/repos/yugangw-msft/azure-cli/releases{/id}","deployments_url":"https://api.github.com/repos/yugangw-msft/azure-cli/deployments","created_at":"2016-07-26T18:58:36Z","updated_at":"2016-07-26T18:58:39Z","pushed_at":"2016-08-04T21:44:07Z","git_url":"git://github.com/yugangw-msft/azure-cli.git","ssh_url":"git@github.com:yugangw-msft/azure-cli.git","clone_url":"https://github.com/yugangw-msft/azure-cli.git","svn_url":"https://github.com/yugangw-msft/azure-cli","homepage":null,"size":5668,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:master","ref":"master","sha":"4a42794f98068c8522415dff9261108a5659edd5","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":51040886,"name":"azure-cli","full_name":"Azure/azure-cli","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-cli","description":"Command-line tools for Azure.","fork":false,"url":"https://api.github.com/repos/Azure/azure-cli","forks_url":"https://api.github.com/repos/Azure/azure-cli/forks","keys_url":"https://api.github.com/repos/Azure/azure-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-cli/teams","hooks_url":"https://api.github.com/repos/Azure/azure-cli/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-cli/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-cli/events","assignees_url":"https://api.github.com/repos/Azure/azure-cli/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-cli/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-cli/tags","blobs_url":"https://api.github.com/repos/Azure/azure-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-cli/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-cli/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-cli/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-cli/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-cli/subscription","commits_url":"https://api.github.com/repos/Azure/azure-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-cli/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-cli/merges","archive_url":"https://api.github.com/repos/Azure/azure-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-cli/downloads","issues_url":"https://api.github.com/repos/Azure/azure-cli/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-cli/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-cli/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-cli/deployments","created_at":"2016-02-04T00:21:51Z","updated_at":"2016-08-04T19:43:01Z","pushed_at":"2016-08-04T21:20:53Z","git_url":"git://github.com/Azure/azure-cli.git","ssh_url":"git@github.com:Azure/azure-cli.git","clone_url":"https://github.com/Azure/azure-cli.git","svn_url":"https://github.com/Azure/azure-cli","homepage":null,"size":8478,"stargazers_count":16,"watchers_count":16,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":99,"forks":8,"open_issues":99,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/602"},"html":{"href":"https://github.com/Azure/azure-cli/pull/602"},"issue":{"href":"https://api.github.com/repos/Azure/azure-cli/issues/602"},"comments":{"href":"https://api.github.com/repos/Azure/azure-cli/issues/602/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/602/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-cli/pulls/602/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-cli/statuses/9142af4fa72826211fcb03af99a1fa878386f054"}}}}
{"actor":{"display_login":"tjprescott"}}