policy: Add Merge API (#11793)

This commit adds a new API in pkg/bucket/policy package called
Merge to merge multiple policies of a user or a group into one
policy document.
This commit is contained in:
Anis Elleuch
2021-03-16 16:50:36 +01:00
committed by GitHub
parent 6160188bf3
commit fa94682e83
12 changed files with 279 additions and 31 deletions

View File

@@ -90,6 +90,12 @@ func (p *Principal) UnmarshalJSON(data []byte) error {
return nil
}
// Clone clones Principal structure
func (p Principal) Clone() Principal {
return NewPrincipal(p.AWS.ToSlice()...)
}
// NewPrincipal - creates new Principal.
func NewPrincipal(principals ...string) Principal {
return Principal{AWS: set.CreateStringSet(principals...)}