-
Notifications
You must be signed in to change notification settings - Fork 583
Barbican V1: Allow multiple ACL types in one request #1763
Copy link
Copy link
Closed
Description
Current implementation supports one call per type. Even though it is not yet supported in Barbican to have an ACL type other than "read", for the future it would be nice to handle multiple ACL types at one call and avoid complex logic in dependent applications. I expect gophercloud to construct json request like:
{
"read": {
"project-access": false,
"users": [
"GG27dVwR9gBMnsOaRoJ1DFJmZfdVjIdW"
]
},
"write": {
"project-access": true,
"users": [
"35t0SzHNIpfiCWppFNpcyDmPQCsESiB1"
]
}
}`I propose the following modification to
| type SetOpts struct { |
// SetOpts represents options to set an ACL on a resource.
type SetOpts []SetOpt
// ToACLSetMap formats a SetOpts into a set request.
func (opts SetOpts) ToACLSetMap() (map[string]interface{}, error) {
b := make(map[string]interface{})
for _, v := range opts {
m, err := gophercloud.BuildRequestBody(v, v.Type)
if err != nil {
return nil, err
}
b[v.Type] = m[v.Type]
}
return b, nil
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels