Method: Oss::Object#get_object_acl

Defined in:
lib/oss/object.rb

#get_object_acl(bucket_name, object_name) ⇒ Object

params:

  • bucket_name

  • object_name



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oss/object.rb', line 271

def get_object_acl(bucket_name, object_name)
  xml_obj = client.get(
      host: "#{bucket_name}.#{client.endpoint}",
      path: "/#{object_name}?acl",
      sign_configs: {resource: "/#{bucket_name}"}
  ).xpath('AccessControlPolicy')

  {
      grant: xml_obj.xpath('AccessControlList/Grant').text,
      owner: {
          id:           xml_obj.xpath('Owner/ID').text,
          display_name: xml_obj.xpath('Owner/DisplayName').text
      }
  }
end