Method: Fog::Storage::AWS::Mock#get_bucket_acl

Defined in:
lib/fog/aws/requests/storage/get_bucket_acl.rb

#get_bucket_acl(bucket_name) ⇒ Object


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/fog/aws/requests/storage/get_bucket_acl.rb', line 53

def get_bucket_acl(bucket_name)
  response = Excon::Response.new
  if acl = self.data[:acls][:bucket][bucket_name]
    response.status = 200
    if acl.is_a?(String)
      response.body = Fog::Storage::AWS.acl_to_hash(acl)
    else
      response.body = acl
    end
  else
    response.status = 404
    raise(Excon::Errors.status_error({:expects => 200}, response))
  end
  response
end