Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Managment: role:list gets Account Manager Roles #61

Closed
pfrickcol opened this issue Aug 2, 2019 · 7 comments
Closed

User Managment: role:list gets Account Manager Roles #61

pfrickcol opened this issue Aug 2, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pfrickcol
Copy link

We are currently using the latest version of the user management branch. A very helpful enhancement that could be made the matches some of the other commands is to add sfcc-ci role:list defaults to displaying the available roles in Account Manager if no --instance is passed in. This would allow us to query what roles are available and utilize that output. Would also be really helpful if you added either a scope:list or something along that line that would allow us to query all the currently available scopes to an organization.

@pfrickcol
Copy link
Author

This is an Enhancement request.

@tobiaslohr tobiaslohr added the enhancement New feature or request label Aug 5, 2019
@tobiaslohr
Copy link
Contributor

Hi @pfrickcol , thanks much for raising!

sfcc-ci role:list defaults to displaying the available roles in Account Manager if no --instance is passed in.

This should not be a large effort, as we can pull the roles available for assignment based on the current user.

Would also be really helpful if you added either a scope:list or something along that line that would allow us to query all the currently available scopes to an organization.

This is an interesting one as well. Lets please track this as separate ticket! Scopes for roles denote Commerce Cloud instances, either via an exact match, e.g. <realm>_<env> like aaaa_dev for development instance of realm aaaa, or via wildcards like aaaa_sbx for all sandboxes of realm aaaa.

What would be the expected output of this? Would it be a list of scopes based on the instances the current user can manage? One proposal I can think of is to have an API change and to have command

sfcc-ci instance:list returning the Commerce Cloud instances available to manage incl. their scope (which is nothing else than an instance id, e.g. aaaa_prd). The current sfcc-ci instance:list returns local configuration of instances configured, which is misleading in terms of the command name anyways. Feedback?

@tobiaslohr tobiaslohr added this to the 2.1.x milestone Aug 5, 2019
@pfrickcol
Copy link
Author

@tobiaslohr glad to here the first one is a fairly easy thing to do. As for the scope I was thinking you have something like sfcc-ci scope:list --org XXX --role XXX and it would return the list of scopes that can be assigned to that role also having the ability to have the output in JSON would be helpful as well.

@tobiaslohr
Copy link
Contributor

@pfrickcol I've pushed a change into the branch to allow returning all roles by calling sfcc-ci roles:list, see bc7a31e and provide feeedback

@pfrickcol
Copy link
Author

Looks to be working to me. It is defaulting to outputting the id, description, roleEnumName. --verbose doesn't seem to operate on the ID's of the account manager role's but that isn't needed in my opinion.

@tobiaslohr
Copy link
Contributor

Right, options like --verbose, --role or --sortby are currently only supported in combination with the --instance option.

In order to get a list of role IDs only you may want to use a tool like jq for JSON processing to further process the output into a flattened list like:
sfcc-ci role:list --json | jq '.content[].id' -r'

@tobiaslohr
Copy link
Contributor

Support for returning a list of Account Manager roles has been added and merged as part of #47

Request for exploring scopes (in fact instances) has been extracted into #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants