Method: AWS::S3::ACL::Bucket#acl

Defined in:
lib/aws/s3/acl.rb

#acl(reload = false) ⇒ Object

The acl method returns and updates the acl for a given bucket.

# Fetch a bucket
bucket = Bucket.find 'marcel'

# Add a grant to the bucket's policy
bucket.acl.grants << some_grant

# Write the changes to the policy
bucket.acl(bucket.acl)


529
530
531
532
533
534
535
# File 'lib/aws/s3/acl.rb', line 529

def acl(reload = false)
  policy = reload.is_a?(ACL::Policy) ? reload : nil
  expirable_memoize(reload) do
    self.class.acl(name, policy) if policy
    self.class.acl(name)
  end
end