Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: addsharing add command to the CLI#19576

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brettkolodny merged 36 commits intomainfrombrett/coder-sharing-share-command-859
Sep 4, 2025

Conversation

brettkolodny
Copy link
Contributor

@brettkolodnybrettkolodny commentedAug 27, 2025
edited
Loading

Adds asharing add command for sharing Workspaces with other users and groups.

The command allows sharing with multiple users, and groups within one command as well as specifying the role (use, oradmin) defaulting touse if none is specified.

In the current implementation when the command completes we show the user the current state of the workspace ACL.

$ coder sharing add apricot-catfish-86 --user=member:admin --group=contractors:useUSER    GROUP        ROLEmember  -            adminmember  contractors  use

If a user is a part of multiple groups, or the workspace has been individually shared with them they will show up multiple times. Although this is a bit confusing at first glance it's important to be able to tell what the maximum role a user may have, and via what ACL they have it.


One piece of UX to consider is that in order to be able to share a Workspace with a user they must have a role that can read that user. In the tests we give the user theScopedRoleOrgAuditor role.

Closescoder/internal#859

@brettkolodnybrettkolodny marked this pull request as ready for reviewAugust 27, 2025 21:01
@brettkolodnybrettkolodnyforce-pushed thebrett/coder-sharing-share-command-859 branch from3ff3630 toa88364cCompareAugust 28, 2025 13:15
@stirby
Copy link
Collaborator

Let's addsharing add as an alias tosharing share. I think it's a little more intuitive and looks better.

brettkolodny reacted with thumbs up emoji

@matifalimatifali changed the titlefeat: addsharing share command to the CLIfeat: addsharing add command to the CLIAug 28, 2025
Copy link

@rafrdzrafrdz left a comment

Choose a reason for hiding this comment

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

Overall looks good! Just some small requests for some validation of user input.

}

for _, user := range users {
userAndRole := nameRoleRegex.FindStringSubmatch(user)

Choose a reason for hiding this comment

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

In the event that this isnil can we add a check to prevent a panic?

Suggested change
userAndRole:=nameRoleRegex.FindStringSubmatch(user)
userAndRole:=nameRoleRegex.FindStringSubmatch(user)
ifuserAndRole==nil {
returnxerrors.Errorf("invalid user format %q: must match pattern 'username:role'",user)
}

}

for _, group := range groups {
groupAndRole := nameRoleRegex.FindStringSubmatch(group)

Choose a reason for hiding this comment

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

Similar validation question touserAndRole here

@brettkolodnybrettkolodny merged commit909acbc intomainSep 4, 2025
26 checks passed
@brettkolodnybrettkolodny deleted the brett/coder-sharing-share-command-859 branchSeptember 4, 2025 21:37
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
1 more reviewer

@rafrdzrafrdzrafrdz approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees

@brettkolodnybrettkolodny

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

coder sharing share command
3 participants
@brettkolodny@stirby@rafrdz

[8]ページ先頭

©2009-2025 Movatter.jp