Skip to content

Commit 7577703

Browse files
authored
Fix operator login acl regression (#492)
* Fix operator login acl regression * wip
1 parent b24d62a commit 7577703

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pkg/acl/endpoints.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,9 @@ func GetAuthorizedEndpoints(actions []string) []string {
284284
rangeTake = operatorRules
285285
}
286286

287-
if len(actions) == 0 {
288-
return []string{}
289-
}
290287
// Prepare new ActionSet structure that will hold all the user actions
291288
userAllowedAction := actionsStringToActionSet(actions)
292-
allowedEndpoints := []string{}
289+
var allowedEndpoints []string
293290
for endpoint, rules := range rangeTake {
294291
// check if user policy matches s3:* or admin:* typesIntersection
295292
endpointActionTypes := rules.actionTypes

pkg/acl/endpoints_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
9494
want: 16,
9595
},
9696
{
97-
name: "no endpoints",
97+
name: "Console User - default endpoints",
9898
args: args{
9999
[]string{},
100100
},
101-
want: 0,
101+
want: 5,
102102
},
103103
}
104104

@@ -138,11 +138,11 @@ func TestOperatorOnlyEndpoints(t *testing.T) {
138138
want: 2,
139139
},
140140
{
141-
name: "Operator Only - no endpoints",
141+
name: "Operator Only - default endpoints",
142142
args: args{
143143
[]string{},
144144
},
145-
want: 0,
145+
want: 2,
146146
},
147147
}
148148

0 commit comments

Comments
 (0)