Skip to content

Commit 22a55ce

Browse files
committed
Creating an org requires admin role
1 parent d8f3f0e commit 22a55ce

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

coderd/users_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func TestPostUsers(t *testing.T) {
173173
client := coderdtest.New(t, nil)
174174
first := coderdtest.CreateFirstUser(t, client)
175175
notInOrg := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
176-
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
176+
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleAdmin(), rbac.RoleMember())
177177
org, err := other.CreateOrganization(context.Background(), codersdk.Me, codersdk.CreateOrganizationRequest{
178178
Name: "another",
179179
})

coderd/workspaces_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"testing"
88
"time"
99

10+
"github.com/coder/coder/coderd/rbac"
11+
1012
"github.com/google/uuid"
1113
"github.com/stretchr/testify/require"
1214

@@ -52,7 +54,7 @@ func TestPostWorkspacesByOrganization(t *testing.T) {
5254
client := coderdtest.New(t, nil)
5355
first := coderdtest.CreateFirstUser(t, client)
5456

55-
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
57+
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleMember(), rbac.RoleAdmin())
5658
org, err := other.CreateOrganization(context.Background(), codersdk.Me, codersdk.CreateOrganizationRequest{
5759
Name: "another",
5860
})

0 commit comments

Comments
 (0)