The acl method is the single point of entry for reading and writing access control list policies for a given object.
# Fetch the acl for the 'kiss.jpg' object in the 'marcel' bucket policy = S3Object.acl 'kiss.jpg', 'marcel' # Modify the policy ... # ... # Send updated policy back to the S3 servers S3Object.acl 'kiss.jpg', 'marcel', policy
# File lib/aws/s3/acl.rb, line 554 def acl(name, bucket = nil, policy = nil) # We're using the second argument as the ACL::Policy if bucket.is_a?(ACL::Policy) policy = bucket bucket = nil end bucket = bucket_name(bucket) path = path!(bucket, name) << '?acl' respond_with ACL::Policy::Response do policy ? put(path, {}, policy.to_xml) : ACL::Policy.new(get(path).policy) end end