Skip to content

Commit 80bbcac

Browse files
committed
pre suggestions
1 parent e14728e commit 80bbcac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

coderd/database/dbauthz/groupsauth_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"testing"
66

7+
"github.com/google/uuid"
78
"github.com/prometheus/client_golang/prometheus"
89
"github.com/stretchr/testify/require"
910

@@ -132,7 +133,7 @@ func TestGroupsAuth(t *testing.T) {
132133
Name: "DifferentOrgAdmin",
133134
Subject: rbac.Subject{
134135
ID: "orgadmin",
135-
Roles: rbac.Roles(must(rbac.RoleIdentifiers{}.Expand())),
136+
Roles: rbac.Roles(must(rbac.RoleIdentifiers{rbac.ScopedRoleOrgUserAdmin(uuid.New())}.Expand())),
136137
Groups: []string{},
137138
Scope: rbac.ExpandableScope(rbac.ScopeAll),
138139
},
@@ -160,6 +161,7 @@ func TestGroupsAuth(t *testing.T) {
160161
require.Len(t, members, tc.MembersExpected, "member count found does not match")
161162
} else {
162163
require.Error(t, err, "member read")
164+
require.True(t, dbauthz.IsNotAuthorizedError(err), "not authorized error")
163165
}
164166
})
165167
}

0 commit comments

Comments
 (0)