Skip to content

chore: add organization member api + cli #13577

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 6 commits into from
Jun 20, 2024
Merged

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Jun 14, 2024

coder organization members add <username | user_id>

@Emyrk Emyrk force-pushed the stevenmasley/add_orgmember_cli branch from 68a5b2b to a4a986d Compare June 17, 2024 14:48
Copy link
Member Author

Emyrk commented Jun 17, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Emyrk and the rest of your teammates on Graphite Graphite

@Emyrk Emyrk marked this pull request as ready for review June 17, 2024 16:49
@Emyrk Emyrk force-pushed the stevenmasley/add_orgmember_cli branch from 47b1864 to bf3bfd0 Compare June 17, 2024 17:46
@Emyrk Emyrk force-pushed the stevenmasley/add_orgmember_cli branch 2 times, most recently from e488414 to 909a7ce Compare June 17, 2024 20:00
@Emyrk Emyrk requested a review from f0ssel June 17, 2024 20:16
Copy link
Contributor

@f0ssel f0ssel left a comment

Choose a reason for hiding this comment

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

:+1, nothing blocking

r.Use(
// Adding a member requires "read" permission
// on the site user. So limited to owners and user-admins.
// TODO: Allow org-admins to add users via some new permission? Or give them
Copy link
Contributor

Choose a reason for hiding this comment

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

For a future PR: I think a new permission would be nice here, I don't think it's intuitive for developers to know that a read permission on a site user grants them access to add new org members.

Copy link
Member Author

Choose a reason for hiding this comment

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

@f0ssel one option is just to not require the read permission to add a user, using the system context to fetch a user.

I agree it is not intuitive at present. Since orgs are still a ways out, I'm not spending too much time on these details atm.

func TestAddMember(t *testing.T) {
t.Parallel()

t.Run("OK", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think testing to error cases like missing user and org 404, etc for posterity could be good as well

@Emyrk Emyrk force-pushed the stevenmasley/add_orgmember_cli branch from 909a7ce to ce367e5 Compare June 18, 2024 20:36
@Emyrk Emyrk merged commit 8e06ad4 into main Jun 20, 2024
28 checks passed
@Emyrk Emyrk deleted the stevenmasley/add_orgmember_cli branch June 20, 2024 14:19
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 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.

3 participants