Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rzrbld committed Jun 28, 2020
1 parent 9aea003 commit f011652
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/handlers/buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,17 @@ func getPolicyWithName(bucketName string) (string, string, error) {
var p policy.BucketAccessPolicy

bp, err := minioClnt.GetBucketPolicyWithContext(context.Background(), bucketName)
if err = json.Unmarshal([]byte(bp), &p); err != nil {
fmt.Println("Error Unmarshal policy")
}
pName := string(policy.GetPolicy(p.Statements, bucketName, ""))
if pName == string(policy.BucketPolicyNone) && bp != "" {
pName = "custom"
policyShort := "none"
if bp != "" {
if err = json.Unmarshal([]byte(bp), &p); err != nil {
fmt.Println("Error Unmarshal policy")
}
pName := string(policy.GetPolicy(p.Statements, bucketName, ""))
if pName == string(policy.BucketPolicyNone) && bp != "" {
pName = "custom"
}
policyShort = policyToString(pName)
}
var policyShort = policyToString(pName)

return policyShort, bp, err
}
Expand Down

0 comments on commit f011652

Please sign in to comment.