aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2022-07-28 19:43:25 -0700
committerGitHub <noreply@github.com>2022-07-28 19:43:25 -0700
commit3e7e922d1691263bdda868d377f944f92b9480d2 (patch)
tree50f55e298cd6b2ca78f3b9c98b291a1bf399c902 /weed
parent89e276de6410dc282657f9429db1b1acb7201130 (diff)
parent1d9a888be97b3ea6f28b106d1b3e08d16b79086c (diff)
downloadseaweedfs-3e7e922d1691263bdda868d377f944f92b9480d2.tar.xz
seaweedfs-3e7e922d1691263bdda868d377f944f92b9480d2.zip
Merge pull request #3378 from vanhtuan0409/change-put-policy
PutUserAction should completely replace identity actions
Diffstat (limited to 'weed')
-rw-r--r--weed/iamapi/iamapi_management_handlers.go12
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)