Methods

AWS::S3::ACL::Bucket::ClassMethods

Public Instance Methods

acl(name = nil, policy = nil) click to toggle source

The acl method is the single point of entry for reading and writing access control list policies for a given bucket.

# Fetch the acl for the 'marcel' bucket
policy = Bucket.acl 'marcel'

# Modify the policy ...
# ...

# Send updated policy back to the S3 servers
Bucket.acl 'marcel', policy
# File lib/aws/s3/acl.rb, line 506
def acl(name = nil, policy = nil)
  if name.is_a?(ACL::Policy)
    policy = name
    name   = nil
  end

  path = path(name) << '?acl'
  respond_with ACL::Policy::Response do
    policy ? put(path, {}, policy.to_xml) : ACL::Policy.new(get(path(name) << '?acl').policy)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.