SetPolicy - Returns new statements containing policy of given bucket name and prefix are appended.
(statements []Statement, policy BucketPolicy, bucketName, prefix string)
| 638 | |
| 639 | // SetPolicy - Returns new statements containing policy of given bucket name and prefix are appended. |
| 640 | func SetPolicy(statements []Statement, policy BucketPolicy, bucketName, prefix string) []Statement { |
| 641 | out := removeStatements(statements, bucketName, prefix) |
| 642 | // fmt.Println("out = ") |
| 643 | // printstatement(out) |
| 644 | ns := newStatements(policy, bucketName, prefix) |
| 645 | // fmt.Println("ns = ") |
| 646 | // printstatement(ns) |
| 647 | |
| 648 | rv := appendStatements(out, ns) |
| 649 | // fmt.Println("rv = ") |
| 650 | // printstatement(rv) |
| 651 | |
| 652 | return rv |
| 653 | } |
| 654 | |
| 655 | // Match function matches wild cards in 'pattern' for resource. |
| 656 | func resourceMatch(pattern, resource string) bool { |