Skip to content

Commit

Permalink
add reader role (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
xh3b4sd authored May 3, 2021
1 parent 6899187 commit 12f17d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ func Test_Ingress_Match_false(t *testing.T) {
role.Member,
},
},
// Case 18
{
l: []label.Label{
resource.Message,
visibility.Private,
action.Create,
role.Reader,
},
},
}

for i, tc := range testCases {
Expand Down Expand Up @@ -300,6 +309,15 @@ func Test_Ingress_Match_true(t *testing.T) {
role.Owner,
},
},
// Case 12
{
l: []label.Label{
resource.Message,
visibility.Private,
action.Search,
role.Reader,
},
},
}

for i, tc := range testCases {
Expand Down
1 change: 1 addition & 0 deletions pkg/ingress/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
{role.Any /*******/, action.Search /***/, visibility.Public /****/, resource.Any /********/},
{role.Member /****/, action.Search /***/, visibility.Private /***/, resource.Any /********/},
{role.Owner /*****/, action.Search /***/, visibility.Private /***/, resource.Any /********/},
{role.Reader /****/, action.Search /***/, visibility.Private /***/, resource.Any /********/},

{role.Owner /*****/, action.Update /***/, visibility.Any /*******/, resource.Any /********/},
}
Expand Down
1 change: 1 addition & 0 deletions pkg/label/role/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ const (
Any label.Label = "role:any"
Member label.Label = "role:member"
Owner label.Label = "role:owner"
Reader label.Label = "role:reader"
Subject label.Label = "role:subject"
)

0 comments on commit 12f17d9

Please sign in to comment.