Method: Fog::Storage::AWS::Mock#put_bucket_acl

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

#put_bucket_acl(bucket_name, acl) ⇒ Object

[View source]

59
60
61
62
63
64
65
66
67
68
# File 'lib/fog/aws/requests/storage/put_bucket_acl.rb', line 59

def put_bucket_acl(bucket_name, acl)
  if acl.is_a?(Hash)
    self.data[:acls][:bucket][bucket_name] = Fog::Storage::AWS.hash_to_acl(acl)
  else
    if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
      raise Excon::Errors::BadRequest.new('invalid x-amz-acl')
    end
    self.data[:acls][:bucket][bucket_name] = acl
  end        
end