mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add a helper method to convert a acl string to a header name/value pair that Swift understands.
This commit is contained in:
parent
d9925930bf
commit
a60b4bdfb8
1 changed files with 17 additions and 0 deletions
|
@ -38,6 +38,23 @@ module Fog
|
|||
def url
|
||||
"#{@scheme}://#{@host}:#{@port}#{@path}"
|
||||
end
|
||||
|
||||
def acl_to_header(acl)
|
||||
header = {}
|
||||
case acl
|
||||
when "private"
|
||||
header['X-Container-Read'] = ""
|
||||
header['X-Container-Write'] = ""
|
||||
when "public-read"
|
||||
header['X-Container-Read'] = ".r:*,.rlistings"
|
||||
when "public-write"
|
||||
header['X-Container-Write'] = "*"
|
||||
when "public-read-write"
|
||||
header['X-Container-Read'] = ".r:*,.rlistings"
|
||||
header['X-Container-Write'] = "*"
|
||||
end
|
||||
header
|
||||
end
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
|
Loading…
Add table
Reference in a new issue