1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-05-18 01:10:34 +02:00

Merge pull request #3378 from vanhtuan0409/change-put-policy

PutUserAction should completely replace identity actions
This commit is contained in:
Chris Lu 2022-07-28 19:43:25 -07:00 committed by GitHub
commit 3e7e922d16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,17 +219,7 @@ func (iama *IamApiServer) PutUserPolicy(s3cfg *iam_pb.S3ApiConfiguration, values
if userName != ident.Name {
continue
}
existedActions := make(map[string]bool, len(ident.Actions))
for _, action := range ident.Actions {
existedActions[action] = true
}
for _, action := range actions {
if !existedActions[action] {
ident.Actions = append(ident.Actions, action)
}
}
ident.Actions = actions
return resp, nil
}
return resp, fmt.Errorf("%s: the user with name %s cannot be found", iam.ErrCodeNoSuchEntityException, userName)