@@ -10,6 +10,7 @@ import (
10
10
"github.com/stretchr/testify/require"
11
11
12
12
"github.com/coder/coder/v2/coderd/coderdtest"
13
+ "github.com/coder/coder/v2/coderd/rbac"
13
14
"github.com/coder/coder/v2/codersdk"
14
15
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
15
16
"github.com/coder/coder/v2/enterprise/coderd/license"
@@ -41,6 +42,7 @@ func TestTemplateInsightsWithTemplateAdminACL(t *testing.T) {
41
42
codersdk .FeatureTemplateRBAC : 1 ,
42
43
},
43
44
}})
45
+ templateAdminClient , _ := coderdtest .CreateAnotherUser (t , client , admin .OrganizationID , rbac .RoleTemplateAdmin ())
44
46
45
47
version := coderdtest .CreateTemplateVersion (t , client , admin .OrganizationID , nil )
46
48
template := coderdtest .CreateTemplate (t , client , admin .OrganizationID , version .ID )
@@ -50,7 +52,7 @@ func TestTemplateInsightsWithTemplateAdminACL(t *testing.T) {
50
52
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitShort )
51
53
defer cancel ()
52
54
53
- err := client .UpdateTemplateACL (ctx , template .ID , codersdk.UpdateTemplateACL {
55
+ err := templateAdminClient .UpdateTemplateACL (ctx , template .ID , codersdk.UpdateTemplateACL {
54
56
UserPerms : map [string ]codersdk.TemplateRole {
55
57
regularUser .ID .String (): codersdk .TemplateRoleAdmin ,
56
58
},
0 commit comments