|
4 | 4 | "context" |
5 | 5 | "testing" |
6 | 6 |
|
| 7 | +"github.com/google/uuid" |
7 | 8 | "github.com/prometheus/client_golang/prometheus" |
8 | 9 | "github.com/stretchr/testify/require" |
9 | 10 |
|
@@ -132,7 +133,7 @@ func TestGroupsAuth(t *testing.T) { |
132 | 133 | Name:"DifferentOrgAdmin", |
133 | 134 | Subject: rbac.Subject{ |
134 | 135 | ID:"orgadmin", |
135 | | -Roles:rbac.Roles(must(rbac.RoleIdentifiers{}.Expand())), |
| 136 | +Roles:rbac.Roles(must(rbac.RoleIdentifiers{rbac.ScopedRoleOrgUserAdmin(uuid.New())}.Expand())), |
136 | 137 | Groups: []string{}, |
137 | 138 | Scope:rbac.ExpandableScope(rbac.ScopeAll), |
138 | 139 | }, |
@@ -160,6 +161,7 @@ func TestGroupsAuth(t *testing.T) { |
160 | 161 | require.Len(t,members,tc.MembersExpected,"member count found does not match") |
161 | 162 | }else { |
162 | 163 | require.Error(t,err,"member read") |
| 164 | +require.True(t,dbauthz.IsNotAuthorizedError(err),"not authorized error") |
163 | 165 | } |
164 | 166 | }) |
165 | 167 | } |
|