Skip to content

Commit 4780564

Browse files
authored
fix: allow user admins to manage groups (#4498)
1 parent 2a1bfb3 commit 4780564

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

coderd/rbac/builtin.go

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ var (
127127
ResourceUser.Type: {ActionCreate, ActionRead, ActionUpdate, ActionDelete},
128128
// Full perms to manage org members
129129
ResourceOrganizationMember.Type: {ActionCreate, ActionRead, ActionUpdate, ActionDelete},
130+
ResourceGroup.Type: {ActionCreate, ActionRead, ActionUpdate, ActionDelete},
130131
}),
131132
}
132133
},

coderd/rbac/builtin_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,15 @@ func TestRolePermissions(t *testing.T) {
369369
false: {memberMe, otherOrgAdmin, otherOrgMember, userAdmin},
370370
},
371371
},
372+
{
373+
Name: "Groups",
374+
Actions: []rbac.Action{rbac.ActionRead},
375+
Resource: rbac.ResourceGroup.InOrg(orgID),
376+
AuthorizeMap: map[bool][]authSubject{
377+
true: {owner, orgAdmin, userAdmin, orgMemberMe},
378+
false: {memberMe, otherOrgAdmin, otherOrgMember, templateAdmin},
379+
},
380+
},
372381
}
373382

374383
for _, c := range testCases {

docs/admin/users.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Coder offers these user roles in the community edition:
99
| | User Admin | Template Admin | Owner |
1010
| ------------------------------------------ | ---------- | -------------- | ----- |
1111
| Add and remove Users || ||
12-
| Manage groups (enterprise) | | | |
12+
| Manage groups (enterprise) | | | |
1313
| Change User roles | | ||
1414
| Manage **ALL** Templates | |||
1515
| View, update and delete **ALL** Workspaces | |||

0 commit comments

Comments
 (0)