Skip to content

Conversation

@yugangw-msft
Copy link
Contributor

@yugangw-msft yugangw-msft commented Aug 3, 2016

Notes by comparing with node cli

  1. 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
  2. Relieve users from the concept of scope, they just need to use either resource group, or resource id
  3. Expose the filters of --all, --include-inherited for people to opt-in to see extra assignments if they like
  4. 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.

/CC:@derekbekoe, @BurtBiel, @tjprescott , @JasonRShaver

@yugangw-msft yugangw-msft changed the title rbac: list & delete assignment, role list and show rbac: list & delete assignment; role definition list & show Aug 3, 2016
@yugangw-msft yugangw-msft force-pushed the list branch 2 times, most recently from f893a25 to 9f79f1a Compare August 3, 2016 18:28
@yugangw-msft
Copy link
Contributor Author

yugangw-msft commented Aug 3, 2016

Command
    az role assignment list

Arguments
    --all              : Show all assignments under the current subscription.
    --assignee         : Represent a user, group, or service principal. supported format: object id,
                         user sign-in name, or service principal name.
    --include-groups   : Include extra assignments to the groups of which the user is a
                         member(transitively). Supported only for a user principal.
    --include-inherited: Include assignments applied on parent scopes.
    --resource-group -g: Use it only if the role or assignment was added at a resource group level.
    --resource-id      : Use it only if the role or assignment was added at the level of a resource.
    --role             : Role name or id.

Command
    az role assignment delete

Arguments
    --assignee         : Represent a user, group, or service principal. supported format: object id,
                         user sign-in name, or service principal name.
    --ids              : Space separated role assignment ids.
    --include-inherited: Include assignments applied on parent scopes.
    --resource-group -g: Use it only if the role or assignment was added at the level of a resource
                         group.
    --resource-id      : Use it only if the role or assignment was added at the level of a resource.
    --role             : Role name or id.

Command
    az role create

Arguments
    --role-definition [Required]: Json formatted content which defines the new role. run 'show-
                                  create-template' to get samples.

Command
    az role list

Arguments
    --custom-role-only : Custom roles only(vs. build-in ones).
    --name -n          : The role's logical name.
    --resource-group -g: Use it only if the role or assignment was added at the level of a resource
                         group.
    --resource-id      : Use it only if the role or assignment was added at the level of a resource.

Command
    az role delete

Arguments
    --name -n [Required]: The role's logical name.
    --custom-role-only  : Custom roles only(vs. build-in ones).
    --resource-group -g : Use it only if the role or assignment was added at the level of a resource
                          group.
    --resource-id       : Use it only if the role or assignment was added at the level of a
                          resource.

Command
    az role show-create-template

@yugangw-msft yugangw-msft force-pushed the list branch 3 times, most recently from 26c9d29 to ff2d08d Compare August 4, 2016 17:40
@yugangw-msft yugangw-msft changed the title rbac: list & delete assignment; role definition list & show rbac: list & delete assignment; role definition create, list and delete Aug 4, 2016
@yugangw-msft yugangw-msft force-pushed the list branch 4 times, most recently from 107b4a4 to 9142af4 Compare August 4, 2016 19:53
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

show_role_create_template [](start = 4, length = 25)

Is there a reason this isn't just part of the "examples" help text for the create role command? It seems odd to have a command that just outputs what is essentially help text (except the taskhelp module but that's totally different)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After our discussion I understand the rationale. Once you've changed the create_role command to be multiple parameters, I'm not sure this would be necessary. Even if we preserve the ability to use a JSON template as the input, they could just get the template from the examples portion of the help file. I'd ask others what they think.


In reply to: 73603847 [](ancestors = 73603847)

@yugangw-msft
Copy link
Contributor Author

yugangw-msft commented Aug 5, 2016

@tjprescott , on a second thought, I feel it better to just get rid of the show-create-template and move it into the sample section in the help. 3 reasons

  1. The json format is well recognized, check out this msdn post
  2. The definition is rather complex, from usabilities aspect, using your favorite json editor is much easier than to type up in the command line which could extend to 10+ command lines.
  3. If possible, i like to be compatible with node version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

roles match [](start = 33, length = 11)

This should be 'more than one role matches' like it was before this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Forgive me, i just could not get this grammar right.

@derekbekoe
Copy link
Member

:shipit:

@yugangw-msft yugangw-msft merged commit f19931c into Azure:master Aug 5, 2016
formulahendry pushed a commit to formulahendry/azure-cli that referenced this pull request Aug 11, 2016
@yugangw-msft yugangw-msft deleted the list branch September 18, 2016 21:25
00Kai0 pushed a commit to 00Kai0/azure-cli that referenced this pull request Apr 7, 2021
* Fixes Azure#591.

* Update index for ER cross connection

* Fix linter violations.
Comment on lines +136 to +137
:param include_groups: include extra assignments to the groups of which the user is a
member(transitively). Supported only for a user principal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include_groups should be declared in _params.py, not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants