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

@@ -93,10 +93,14 @@ func (actionSet ActionSet) ToSlice() []Action {
for action := range actionSet {
actions = append(actions, action)
}
return actions
}
// Clone clones ActionSet structure
func (actionSet ActionSet) Clone() ActionSet {
return NewActionSet(actionSet.ToSlice()...)
}
// UnmarshalJSON - decodes JSON data to ActionSet.
func (actionSet *ActionSet) UnmarshalJSON(data []byte) error {
var sset set.StringSet