Skip to content

Commit 43f0057

Browse files
committed
fix tests
1 parent c1da03d commit 43f0057

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

enterprise/cli/organizationmembers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestEnterpriseListOrganizationMembers(t *testing.T) {
9494

9595
ctx := testutil.Context(t, testutil.WaitMedium)
9696
//nolint:gocritic // only owners can patch roles
97-
customRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
97+
customRole, err := ownerClient.CreateOrganizationRole(ctx, codersdk.Role{
9898
Name: "custom",
9999
OrganizationID: owner.OrganizationID.String(),
100100
DisplayName: "Custom Role",
@@ -147,7 +147,7 @@ func TestAssignOrganizationMemberRole(t *testing.T) {
147147

148148
ctx := testutil.Context(t, testutil.WaitMedium)
149149
// nolint:gocritic // requires owner role to create
150-
customRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
150+
customRole, err := ownerClient.CreateOrganizationRole(ctx, codersdk.Role{
151151
Name: "custom-role",
152152
OrganizationID: owner.OrganizationID.String(),
153153
DisplayName: "Custom Role",

enterprise/cli/templatecreate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func TestTemplateCreate(t *testing.T) {
168168
ctx := testutil.Context(t, testutil.WaitMedium)
169169

170170
//nolint:gocritic // owner required to make custom roles
171-
orgTemplateAdminRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
171+
orgTemplateAdminRole, err := ownerClient.CreateOrganizationRole(ctx, codersdk.Role{
172172
Name: "org-template-admin",
173173
OrganizationID: secondOrg.ID.String(),
174174
OrganizationPermissions: codersdk.CreatePermissions(map[codersdk.RBACResource][]codersdk.RBACAction{

enterprise/coderd/templates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ func TestTemplates(t *testing.T) {
751751
})
752752

753753
//nolint:gocritic // owner required to make custom roles
754-
orgTemplateAdminRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
754+
orgTemplateAdminRole, err := ownerClient.CreateOrganizationRole(ctx, codersdk.Role{
755755
Name: "org-template-admin",
756756
OrganizationID: secondOrg.ID.String(),
757757
OrganizationPermissions: codersdk.CreatePermissions(map[codersdk.RBACResource][]codersdk.RBACAction{

enterprise/coderd/userauth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ func TestEnterpriseUserLogin(t *testing.T) {
705705

706706
ctx := testutil.Context(t, testutil.WaitShort)
707707
//nolint:gocritic // owner required
708-
customRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
708+
customRole, err := ownerClient.CreateOrganizationRole(ctx, codersdk.Role{
709709
Name: "custom-role",
710710
OrganizationID: owner.OrganizationID.String(),
711711
OrganizationPermissions: []codersdk.Permission{},

enterprise/coderd/users_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func TestAssignCustomOrgRoles(t *testing.T) {
271271

272272
ctx := testutil.Context(t, testutil.WaitShort)
273273
// Create a custom role as an organization admin that allows making templates.
274-
auditorRole, err := client.PatchOrganizationRole(ctx, codersdk.Role{
274+
auditorRole, err := client.CreateOrganizationRole(ctx, codersdk.Role{
275275
Name: "org-template-admin",
276276
OrganizationID: owner.OrganizationID.String(),
277277
DisplayName: "Template Admin",

site/src/api/rbacresources_gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ export const RBACResourceActions: Partial<
1616
},
1717
assign_org_role: {
1818
assign: "ability to assign org scoped roles",
19-
create: "ability to create/delete/edit custom roles within an organization",
19+
create: "ability to create/delete custom roles within an organization",
2020
delete: "ability to delete org scoped roles",
2121
read: "view what roles are assignable",
22+
update: "ability to edit custom roles within an organization",
2223
},
2324
assign_role: {
2425
assign: "ability to assign roles",
2526
create: "ability to create/delete/edit custom roles",
2627
delete: "ability to unassign roles",
2728
read: "view what roles are assignable",
29+
update: "ability to edit custom roles",
2830
},
2931
audit_log: {
3032
create: "create new audit log entries",

0 commit comments

Comments
 (0)