module 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
506 def acl(name = nil, policy = nil)
507   if name.is_a?(ACL::Policy)
508     policy = name
509     name   = nil
510   end
511 
512   path = path(name) << '?acl'
513   respond_with ACL::Policy::Response do
514     policy ? put(path, {}, policy.to_xml) : ACL::Policy.new(get(path(name) << '?acl').policy)
515   end
516 end