Skip to content

Commit 9aff25d

Browse files
committed
permissions comment
1 parent 3b60247 commit 9aff25d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cli/organizationmembers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func (r *RootCmd) addOrganizationMember() *serpent.Command {
4646
return err
4747
}
4848
user := inv.Args[0]
49+
4950
_, err = client.PostOrganizationMember(ctx, organization.ID, user)
5051
if err != nil {
5152
return xerrors.Errorf("could not add member to organization: %w", err)

coderd/coderd.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,10 @@ func New(options *Options) *API {
847847
r.Route("/{user}", func(r chi.Router) {
848848
r.Group(func(r chi.Router) {
849849
r.Use(
850+
// Adding a member requires "read" permission
851+
// on the site user. So limited to owners and user-admins.
852+
// TODO: Allow org-admins to add users via some new permission? Or give them
853+
// read on site users.
850854
httpmw.ExtractUserParam(options.Database),
851855
)
852856
r.Post("/", api.postOrganizationMember)

0 commit comments

Comments
 (0)