Merged
Conversation
in the user describe command.
if the arguments were not provided properly
a054864 to
cde16b7
Compare
…ed from a cookie authenticated user
They are not useful while use a management api key, since invites can't be accepted/rejected while using one.
assign/remove role commands to keep consistency with permission management
JustAwesomeGuy
previously approved these changes
Apr 10, 2026
JustAwesomeGuy
left a comment
There was a problem hiding this comment.
Lgtm! Just have a little nitpick. Feel free to ignore.
internal/cmd/iam/resolve.go
Outdated
| // modifyUserRoles calls AssignUserRoles with the given add/delete IDs, then | ||
| // fetches and prints the resulting role list. errVerb is used in the error | ||
| // message ("failed to <errVerb> roles"). | ||
| func modifyUserRoles(s *state.State, cmd *cobra.Command, client *qcloudapi.Client, accountID string, user *iamv1.User, addIDs, removeIDs []string, errVerb string) error { |
There was a problem hiding this comment.
Is errVerb necessary? I think we can assume it from the arguments or just print failed to modify roles: %w and keep an argument list a bit shorter.
Collaborator
Author
There was a problem hiding this comment.
that's a good point, lemme change it, the less arguments the better.
… it's too much and a generic error can be returned
JustAwesomeGuy
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the
iamcommand group with user management. Invite management has not been included because the api calls require the actor type to be user (i.e. a browser authenticated user). That leaves the possible commands in the CLI to only allow role management as user mutations.Commands introduced
qcloud iam user list— list all users in the accountqcloud iam user describe <user-id-or-email>— show details for a userqcloud iam user assign-role <user-id-or-email> --role <role>— assign one or more roles to a userqcloud iam user remove-role <user-id-or-email> --role <role>— remove one or more roles from a user