Skip to content

Commit d11d83c

Browse files
authored
chore: Template-admin cannot create/update/delete workspaces (#4329)
This perm was changed to only be able to read workspaces
1 parent bbebc1a commit d11d83c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

coderd/rbac/builtin_test.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,25 @@ func TestRolePermissions(t *testing.T) {
174174
},
175175
},
176176
{
177-
Name: "MyWorkspaceInOrg",
177+
Name: "ReadMyWorkspaceInOrg",
178178
// When creating the WithID won't be set, but it does not change the result.
179-
Actions: []rbac.Action{rbac.ActionCreate, rbac.ActionRead, rbac.ActionUpdate, rbac.ActionDelete},
179+
Actions: []rbac.Action{rbac.ActionRead},
180180
Resource: rbac.ResourceWorkspace.InOrg(orgID).WithOwner(currentUser.String()),
181181
AuthorizeMap: map[bool][]authSubject{
182182
true: {owner, orgMemberMe, orgAdmin, templateAdmin},
183183
false: {memberMe, otherOrgAdmin, otherOrgMember, userAdmin},
184184
},
185185
},
186+
{
187+
Name: "C_RDMyWorkspaceInOrg",
188+
// When creating the WithID won't be set, but it does not change the result.
189+
Actions: []rbac.Action{rbac.ActionCreate, rbac.ActionUpdate, rbac.ActionDelete},
190+
Resource: rbac.ResourceWorkspace.InOrg(orgID).WithOwner(currentUser.String()),
191+
AuthorizeMap: map[bool][]authSubject{
192+
true: {owner, orgMemberMe, orgAdmin},
193+
false: {memberMe, otherOrgAdmin, otherOrgMember, userAdmin, templateAdmin},
194+
},
195+
},
186196
{
187197
Name: "MyWorkspaceInOrgExecution",
188198
// When creating the WithID won't be set, but it does not change the result.

0 commit comments

Comments
 (0)