Skip to content

Commit 04d9166

Browse files
committed
Update unit test with perm changes
1 parent f1ed8b3 commit 04d9166

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

coderd/authorize_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestCheckPermissions(t *testing.T) {
103103
Client: orgAdminClient,
104104
UserID: orgAdminUser.ID,
105105
Check: map[string]bool{
106-
readAllUsers: true,
106+
readAllUsers: false,
107107
readMyself: true,
108108
readOwnWorkspaces: true,
109109
readOrgWorkspaces: true,
@@ -115,7 +115,7 @@ func TestCheckPermissions(t *testing.T) {
115115
Client: memberClient,
116116
UserID: memberUser.ID,
117117
Check: map[string]bool{
118-
readAllUsers: true,
118+
readAllUsers: false,
119119
readMyself: true,
120120
readOwnWorkspaces: true,
121121
readOrgWorkspaces: false,

enterprise/coderd/groups_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ func TestGroup(t *testing.T) {
474474
})
475475
require.NoError(t, err)
476476

477-
ggroup, err := client1.Group(ctx, group.ID)
478-
require.NoError(t, err)
479-
require.Equal(t, group, ggroup)
477+
_, err = client1.Group(ctx, group.ID)
478+
require.Error(t, err, "regular users cannot read groups")
480479
})
481480

482481
t.Run("FilterDeletedUsers", func(t *testing.T) {

0 commit comments

Comments
 (0)