Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
pre suggestions
  • Loading branch information
Emyrk committed Aug 12, 2024
commit 80bbcac4e8463445df6802c40fe5a59e875001dd
4 changes: 3 additions & 1 deletion coderd/database/dbauthz/groupsauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"testing"

"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -132,7 +133,7 @@ func TestGroupsAuth(t *testing.T) {
Name: "DifferentOrgAdmin",
Subject: rbac.Subject{
ID: "orgadmin",
Roles: rbac.Roles(must(rbac.RoleIdentifiers{}.Expand())),
Roles: rbac.Roles(must(rbac.RoleIdentifiers{rbac.ScopedRoleOrgUserAdmin(uuid.New())}.Expand())),
Groups: []string{},
Scope: rbac.ExpandableScope(rbac.ScopeAll),
},
Expand Down Expand Up @@ -160,6 +161,7 @@ func TestGroupsAuth(t *testing.T) {
require.Len(t, members, tc.MembersExpected, "member count found does not match")
} else {
require.Error(t, err, "member read")
require.True(t, dbauthz.IsNotAuthorizedError(err), "not authorized error")
}
})
}
Expand Down
Loading