Returns policy of given object statement.
(statement Statement)
| 536 | |
| 537 | // Returns policy of given object statement. |
| 538 | func getObjectPolicy(statement Statement) (readOnly, writeOnly bool) { |
| 539 | if statement.Effect == "Allow" && |
| 540 | statement.Principal.AWS.Contains("*") && |
| 541 | statement.Conditions == nil { |
| 542 | if statement.Actions.Intersection(readOnlyObjectActions).Equals(readOnlyObjectActions) { |
| 543 | readOnly = true |
| 544 | } |
| 545 | if statement.Actions.Intersection(writeOnlyObjectActions).Equals(writeOnlyObjectActions) { |
| 546 | writeOnly = true |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | return readOnly, writeOnly |
| 551 | } |
| 552 | |
| 553 | // GetPolicy - Returns policy of given bucket name, prefix in given statements. |
| 554 | func GetPolicy(statements []Statement, bucketName, prefix string) BucketPolicy { |