ruby/example_code/s3/s3_set_bucket_object_acls.rb
def run_me
  bucket_name = 'doc-example-bucket'
  object_key = 'my-file-1.txt'
  permission = 'READ'
  owner_id = 'b380d412791d395dbcdc1fb1728b32a7cd07edae6467220ac4b7c0769EXAMPLE'
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)

  if object_acl_set_for_owner_id?(
    s3_client,
    bucket_name,
    object_key,
    permission,
    owner_id
  )
    puts 'Object ACL set.'
  else
    puts 'Object ACL not set.'
  end
end
# Full example call:
# Replace us-west-2 with the AWS Region you're using for Amazon S3.

Full example call:
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Full example call : Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .
def run_me
  bucket_name = 'doc-example-bucket'
  object_key = 'my-file-1.txt'
  permission = 'READ'
  owner_id = 'b380d412791d395dbcdc1fb1728b32a7cd07edae6467220ac4b7c0769EXAMPLE'
  region = 'us-west-2'
  s3_client = Aws::S3::Client.new(region: region)
  if object_acl_set_for_owner_id?(
    s3_client,
    bucket_name,
    object_key,
    permission,
    owner_id
  )
    puts 'Object ACL set.'
  else
    puts 'Object ACL not set.'
  end
end
def run_me bucket_name = 'doc-example-bucket' object_key = 'my-file-1.txt' permission = 'READ' owner_id = 'b380d412791d395dbcdc1fb1728b32a7cd07edae6467220ac4b7c0769EXAMPLE' region = 'us-west-2' s3_client = Aws :: S3 :: Client . new ( region : region ) if object_acl_set_for_owner_id? ( s3_client , bucket_name , object_key , permission , owner_id ) puts 'Object ACL set.' else puts 'Object ACL not set.' end end
Full example call:
Replace us-west-2 with the AWS Region you're using for Amazon S3.
Full example call : Replace us - west - 2 with the AWS Region you ' re using for Amazon S3 .