Skip to content

chore: implement assign organization roles from the cli #13558

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

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Jun 12, 2024

Basic functionality to assign roles to an organization member via cli.

coder organizations members edit-roles <username> [roles ...]
# example
coder organizations members edit-roles emyrk organization-admin custom-role

Copy link
Member Author

Emyrk commented Jun 12, 2024

@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from b665268 to a6744b3 Compare June 12, 2024 18:24
@Emyrk Emyrk force-pushed the stevenmasley/org_member_cli branch from dfded68 to 1b3a9b7 Compare June 12, 2024 18:38
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from a6744b3 to eacff69 Compare June 12, 2024 18:38
@Emyrk Emyrk force-pushed the stevenmasley/org_member_cli branch from 1b3a9b7 to e605d37 Compare June 12, 2024 18:49
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from eacff69 to 979b3d8 Compare June 12, 2024 18:49
@Emyrk Emyrk force-pushed the stevenmasley/org_member_cli branch from e605d37 to d23e335 Compare June 12, 2024 18:53
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from 979b3d8 to 45f4baa Compare June 12, 2024 18:53
@Emyrk Emyrk force-pushed the stevenmasley/org_member_cli branch from d23e335 to 9c1fda7 Compare June 12, 2024 19:26
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from 45f4baa to 46067a6 Compare June 12, 2024 19:26
@Emyrk Emyrk force-pushed the stevenmasley/org_member_cli branch from 9c1fda7 to 0012858 Compare June 12, 2024 19:55
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from 46067a6 to 7d98e6c Compare June 12, 2024 19:55
Base automatically changed from stevenmasley/org_member_cli to main June 12, 2024 20:07
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch 2 times, most recently from ec0f038 to 24409b0 Compare June 13, 2024 14:33
@Emyrk Emyrk marked this pull request as ready for review June 13, 2024 14:37
@Emyrk Emyrk requested a review from f0ssel June 13, 2024 14:48
@@ -11,16 +12,74 @@ import (
)

func (r *RootCmd) organizationMembers() *serpent.Command {
cmd := &serpent.Command{
Use: "members",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this ready for end users to start consuming? If not, do we want to start with it hidden?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not, but the parent command is hidden:

Hidden: true, // Hidden until these commands are complete.

So this is also hidden

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

userIdentifier := inv.Args[0]

member, err := client.UpdateOrganizationMemberRoles(ctx, organization.ID, userIdentifier, codersdk.UpdateRoles{
Roles: inv.Args[1:],
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I would prefer this be declared as a variable under userIdentifier to be slightly more readable, but dealers choice.

Basic functionality to assign roles to an organization member via cli.
@Emyrk Emyrk force-pushed the stevenmasley/org_member_assign_cli branch from 24409b0 to 946a3ac Compare June 13, 2024 19:37
@Emyrk Emyrk merged commit 7d51515 into main Jun 13, 2024
27 checks passed
@Emyrk Emyrk deleted the stevenmasley/org_member_assign_cli branch June 13, 2024 19:49
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants