Skip to content

Commit bf439e8

Browse files
committed
update rbac perm list test
1 parent 5604517 commit bf439e8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

coderd/rbac/roles_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,17 @@ func TestRolePermissions(t *testing.T) {
232232
false: {setOtherOrg, orgAuditor, orgUserAdmin, memberMe, userAdmin, orgMemberMe},
233233
},
234234
},
235+
{
236+
Name: "UseTemplates",
237+
Actions: []policy.Action{policy.ActionUse},
238+
Resource: rbac.ResourceTemplate.InOrg(orgID).WithGroupACL(map[string][]policy.Action{
239+
groupID.String(): {policy.ActionUse},
240+
}),
241+
AuthorizeMap: map[bool][]hasAuthSubjects{
242+
true: {owner, orgAdmin, templateAdmin, orgTemplateAdmin, groupMemberMe},
243+
false: {setOtherOrg, orgAuditor, orgUserAdmin, memberMe, userAdmin, orgMemberMe},
244+
},
245+
},
235246
{
236247
Name: "Files",
237248
Actions: []policy.Action{policy.ActionCreate},

0 commit comments

Comments
 (0)