Skip to content

Commit c5c9752

Browse files
committed
fix: No org admins until organizations are in the UI
Until organizations have management UI, we should not set any org admins. This goes around the site wide perms transparently and is confusing to users.
1 parent ad0dd1b commit c5c9752

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

coderd/organizations.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ func (api *API) postOrganizations(rw http.ResponseWriter, r *http.Request) {
7676
CreatedAt: database.Now(),
7777
UpdatedAt: database.Now(),
7878
Roles: []string{
79-
rbac.RoleOrgAdmin(organization.ID),
79+
// TODO: When organizations are allowed to be created, we should
80+
// come back to determining the default role of the person who
81+
// creates the org. Until that happens, all users in an organization
82+
// should be just regular members.
83+
rbac.RoleOrgMember(organization.ID),
8084
},
8185
})
8286
if err != nil {

coderd/users.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,11 @@ func (api *API) CreateUser(ctx context.Context, store database.Store, req Create
10711071
return xerrors.Errorf("create organization: %w", err)
10721072
}
10731073
req.OrganizationID = organization.ID
1074-
orgRoles = append(orgRoles, rbac.RoleOrgAdmin(req.OrganizationID))
1074+
// TODO: When organizations are allowed to be created, we should
1075+
// come back to determining the default role of the person who
1076+
// creates the org. Until that happens, all users in an organization
1077+
// should be just regular members.
1078+
orgRoles = append(orgRoles, rbac.RoleOrgMember(req.OrganizationID))
10751079

10761080
_, err = tx.InsertAllUsersGroup(ctx, organization.ID)
10771081
if err != nil {

0 commit comments

Comments
 (0)