Chris Lu
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
7 deletions
-
weed/iamapi/iamapi_management_handlers.go
|
|
@ -213,24 +213,19 @@ func (iama *IamApiServer) PutUserPolicy(s3cfg *iam_pb.S3ApiConfiguration, values |
|
|
|
if err != nil { |
|
|
|
return PutUserPolicyResponse{}, err |
|
|
|
} |
|
|
|
isFound := false |
|
|
|
policyDocuments[policyName] = &policyDocument |
|
|
|
actions := GetActions(&policyDocument) |
|
|
|
for _, ident := range s3cfg.Identities { |
|
|
|
if userName != ident.Name { |
|
|
|
continue |
|
|
|
} |
|
|
|
isFound = true |
|
|
|
for _, action := range actions { |
|
|
|
ident.Actions = append(ident.Actions, action) |
|
|
|
} |
|
|
|
break |
|
|
|
return resp, nil |
|
|
|
} |
|
|
|
if !isFound { |
|
|
|
return resp, fmt.Errorf("%s: the user with name %s cannot be found", iam.ErrCodeNoSuchEntityException, userName) |
|
|
|
} |
|
|
|
return resp, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (iama *IamApiServer) GetUserPolicy(s3cfg *iam_pb.S3ApiConfiguration, values url.Values) (resp GetUserPolicyResponse, err error) { |
|
|
|
userName := values.Get("UserName") |
|
|
|