diff options
| author | Tuan Vuong <vanhtuan0409@gmail.com> | 2022-07-28 17:02:56 +0700 |
|---|---|---|
| committer | Tuan Vuong <vanhtuan0409@gmail.com> | 2022-07-28 17:02:56 +0700 |
| commit | 1d9a888be97b3ea6f28b106d1b3e08d16b79086c (patch) | |
| tree | 249281a4c7befae8549a4aba3567e4e7bc7c982c /weed | |
| parent | 32d0413be1fbf114268284b7cf6415a518195212 (diff) | |
| download | seaweedfs-1d9a888be97b3ea6f28b106d1b3e08d16b79086c.tar.xz seaweedfs-1d9a888be97b3ea6f28b106d1b3e08d16b79086c.zip | |
PutUserAction should completely replace identity actions
Diffstat (limited to 'weed')
| -rw-r--r-- | weed/iamapi/iamapi_management_handlers.go | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/weed/iamapi/iamapi_management_handlers.go b/weed/iamapi/iamapi_management_handlers.go index 8a42aa936..77efcf24e 100644 --- a/weed/iamapi/iamapi_management_handlers.go +++ b/weed/iamapi/iamapi_management_handlers.go @@ -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) |
