Fix operator login acl regression (#492)

* Fix operator login acl regression

* wip
This commit is contained in:
Lenin Alevski
2020-12-08 22:10:43 -06:00
committed by GitHub
parent b24d62a695
commit 7577703d64
2 changed files with 5 additions and 8 deletions

View File

@@ -284,12 +284,9 @@ func GetAuthorizedEndpoints(actions []string) []string {
rangeTake = operatorRules
}
if len(actions) == 0 {
return []string{}
}
// Prepare new ActionSet structure that will hold all the user actions
userAllowedAction := actionsStringToActionSet(actions)
allowedEndpoints := []string{}
var allowedEndpoints []string
for endpoint, rules := range rangeTake {
// check if user policy matches s3:* or admin:* typesIntersection
endpointActionTypes := rules.actionTypes

View File

@@ -94,11 +94,11 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
want: 16,
},
{
name: "no endpoints",
name: "Console User - default endpoints",
args: args{
[]string{},
},
want: 0,
want: 5,
},
}
@@ -138,11 +138,11 @@ func TestOperatorOnlyEndpoints(t *testing.T) {
want: 2,
},
{
name: "Operator Only - no endpoints",
name: "Operator Only - default endpoints",
args: args{
[]string{},
},
want: 0,
want: 2,
},
}