Skip to content

Commit

Permalink
RHINENG-9704: fix rbac tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka committed Apr 25, 2024
1 parent 778eec3 commit c1300e3
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions manager/middlewares/rbac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ func TestPermissionsSingleWrite(t *testing.T) {
func TestPermissionsSingleRead(t *testing.T) {
// handler needs `patch:single:read`
handler := "SingleRead"
granularPerms = map[string]struct {
Permission string
Read bool
Write bool
}{"SingleRead": {"patch:single:read", true, false}}
granularPerms = map[string]string{"SingleRead": "patch:single:read"}
access := rbac.AccessPagination{
Data: []rbac.Access{
{Permission: "patch:*:*"},
Expand Down Expand Up @@ -158,11 +154,7 @@ func TestPermissionsSingleRead(t *testing.T) {
func TestPermissionsSingleReadWrite(t *testing.T) {
// handler needs `patch:single:read`
handler := "SingleReadWrite"
granularPerms = map[string]struct {
Permission string
Read bool
Write bool
}{"SingleReadWrite": {"patch:single:*", true, true}}
granularPerms = map[string]string{"SingleReadWrite": "patch:single:*"}
access := rbac.AccessPagination{
Data: []rbac.Access{
{Permission: "patch:*:*"},
Expand Down Expand Up @@ -223,11 +215,7 @@ func TestPermissionsSingleReadWrite(t *testing.T) {
func TestPermissionsRead(t *testing.T) {
// handler needs `patch:single:read`
handler := "Read"
granularPerms = map[string]struct {
Permission string
Read bool
Write bool
}{"Read": {"patch:*:read", true, false}}
granularPerms = map[string]string{"Read": "patch:*:read"}
access := rbac.AccessPagination{
Data: []rbac.Access{
{Permission: "patch:*:*"},
Expand Down

0 comments on commit c1300e3

Please sign in to comment.