1
0
Fork 0
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:
Rupak Ganguly 2011-07-13 19:25:47 -04:00
parent d9925930bf
commit a60b4bdfb8

View file

@ -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