MCPcopy
hub / github.com/minio/minio-go / SetPolicy

Function SetPolicy

pkg/policy/bucket-policy.go:640–653  ·  view source on GitHub ↗

SetPolicy - Returns new statements containing policy of given bucket name and prefix are appended.

(statements []Statement, policy BucketPolicy, bucketName, prefix string)

Source from the content-addressed store, hash-verified

638
639// SetPolicy - Returns new statements containing policy of given bucket name and prefix are appended.
640func 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.
656func resourceMatch(pattern, resource string) bool {

Callers 1

TestSetPolicyFunction · 0.85

Calls 3

removeStatementsFunction · 0.85
newStatementsFunction · 0.85
appendStatementsFunction · 0.85

Tested by 1

TestSetPolicyFunction · 0.68