@@ -57,7 +57,7 @@ func TestCustomOrganizationRole(t *testing.T) {
57
57
ctx := testutil .Context (t , testutil .WaitMedium )
58
58
59
59
//nolint:gocritic // owner is required for this
60
- role , err := owner .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
60
+ role , err := owner .CreateOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
61
61
require .NoError (t , err , "upsert role" )
62
62
63
63
// Assign the custom template admin role
@@ -111,7 +111,7 @@ func TestCustomOrganizationRole(t *testing.T) {
111
111
ctx := testutil .Context (t , testutil .WaitMedium )
112
112
113
113
//nolint:gocritic // owner is required for this
114
- role , err := owner .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
114
+ role , err := owner .CreateOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
115
115
require .NoError (t , err , "upsert role" )
116
116
117
117
// Remove the license to block enterprise functionality
@@ -124,7 +124,7 @@ func TestCustomOrganizationRole(t *testing.T) {
124
124
}
125
125
126
126
// Verify functionality is lost
127
- _ , err = owner .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
127
+ _ , err = owner .UpdateOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
128
128
require .ErrorContains (t , err , "Custom Roles is an Enterprise feature" )
129
129
130
130
// Assign the custom template admin role
@@ -152,7 +152,7 @@ func TestCustomOrganizationRole(t *testing.T) {
152
152
153
153
ctx := testutil .Context (t , testutil .WaitMedium )
154
154
//nolint:gocritic // owner is required for this
155
- role , err := owner .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
155
+ role , err := owner .CreateOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
156
156
require .NoError (t , err , "upsert role" )
157
157
158
158
// Assign the custom template admin role
@@ -169,7 +169,7 @@ func TestCustomOrganizationRole(t *testing.T) {
169
169
newRole .SitePermissions = nil
170
170
newRole .OrganizationPermissions = nil
171
171
newRole .UserPermissions = nil
172
- _ , err = owner .PatchOrganizationRole (ctx , newRole )
172
+ _ , err = owner .UpdateOrganizationRole (ctx , newRole )
173
173
require .NoError (t , err , "upsert role with override" )
174
174
175
175
// The role should no longer have template perms
@@ -203,7 +203,7 @@ func TestCustomOrganizationRole(t *testing.T) {
203
203
ctx := testutil .Context (t , testutil .WaitMedium )
204
204
205
205
//nolint:gocritic // owner is required for this
206
- _ , err := owner .PatchOrganizationRole (ctx , codersdk.Role {
206
+ _ , err := owner .CreateOrganizationRole (ctx , codersdk.Role {
207
207
Name : "Bad_Name" , // No underscores allowed
208
208
DisplayName : "Testing Purposes" ,
209
209
OrganizationID : first .OrganizationID .String (),
@@ -232,7 +232,7 @@ func TestCustomOrganizationRole(t *testing.T) {
232
232
ctx := testutil .Context (t , testutil .WaitMedium )
233
233
234
234
//nolint:gocritic // owner is required for this
235
- _ , err := owner .PatchOrganizationRole (ctx , codersdk.Role {
235
+ _ , err := owner .CreateOrganizationRole (ctx , codersdk.Role {
236
236
Name : "owner" , // Reserved
237
237
DisplayName : "Testing Purposes" ,
238
238
OrganizationID : first .OrganizationID .String (),
@@ -270,7 +270,7 @@ func TestCustomOrganizationRole(t *testing.T) {
270
270
}
271
271
272
272
//nolint:gocritic // owner is required for this
273
- _ , err := owner .PatchOrganizationRole (ctx , siteRole )
273
+ _ , err := owner .CreateOrganizationRole (ctx , siteRole )
274
274
require .ErrorContains (t , err , "site wide permissions" )
275
275
276
276
userRole := templateAdminCustom (first .OrganizationID )
@@ -282,7 +282,7 @@ func TestCustomOrganizationRole(t *testing.T) {
282
282
}
283
283
284
284
//nolint:gocritic // owner is required for this
285
- _ , err = owner .PatchOrganizationRole (ctx , userRole )
285
+ _ , err = owner .UpdateOrganizationRole (ctx , userRole )
286
286
require .ErrorContains (t , err , "not allowed to assign user permissions" )
287
287
})
288
288
@@ -307,7 +307,7 @@ func TestCustomOrganizationRole(t *testing.T) {
307
307
newRole .OrganizationID = "0000" // This is not a valid uuid
308
308
309
309
//nolint:gocritic // owner is required for this
310
- _ , err := owner .PatchOrganizationRole (ctx , newRole )
310
+ _ , err := owner .CreateOrganizationRole (ctx , newRole )
311
311
require .ErrorContains (t , err , "Resource not found" )
312
312
})
313
313
@@ -329,7 +329,7 @@ func TestCustomOrganizationRole(t *testing.T) {
329
329
orgAdmin , orgAdminUser := coderdtest .CreateAnotherUser (t , owner , first .OrganizationID , rbac .ScopedRoleOrgAdmin (first .OrganizationID ))
330
330
ctx := testutil .Context (t , testutil .WaitMedium )
331
331
332
- createdRole , err := orgAdmin .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
332
+ createdRole , err := orgAdmin .CreateOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
333
333
require .NoError (t , err , "upsert role" )
334
334
335
335
//nolint:gocritic // org_admin cannot assign to themselves
@@ -389,7 +389,7 @@ func TestCustomOrganizationRole(t *testing.T) {
389
389
orgAdmin , orgAdminUser := coderdtest .CreateAnotherUser (t , owner , first .OrganizationID , rbac .ScopedRoleOrgAdmin (first .OrganizationID ))
390
390
ctx := testutil .Context (t , testutil .WaitMedium )
391
391
392
- createdRole , err := orgAdmin .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
392
+ createdRole , err := orgAdmin .CreateOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
393
393
require .NoError (t , err , "upsert role" )
394
394
395
395
customRoleIdentifier := rbac.RoleIdentifier {
0 commit comments