module Fog module Storage class AWS private def self.hash_to_acl(acl) data = <<-DATA #{acl['Owner']['ID']} #{acl['Owner']['DisplayName']} DATA acl['AccessControlList'].each do |grant| data << " \n" type = case grant['Grantee'].keys.sort when ['DisplayName', 'ID'] 'CanonicalUser' when ['EmailAddress'] 'AmazonCustomerByEmail' when ['URI'] 'Group' end data << " \n" data << " #{grant['Grantee']['ID']}\n" data << " #{grant['Grantee']['DisplayName']}\n" data << " \n" data << " #{grant['Permission']}\n" data << " \n" end data << <<-DATA DATA data end end end end