How can you do the equivalent of:
s3cmd setacl --acl-grant=read:82b82d14a8d011e09d86001cc029a3688cdd635ea8d011e0b499001cc029a3689052a4f4a8d011e0bd25001cc029a368 s3://somebucket/some/path/to/file
in Ruby? (preferably by using the 'aws-s3' gem)
=== Edit ===
As Soren suggests below, something similar to this should work:
grant = AWS::S3::ACL::Grant.new
grant.permission = 'READ'
grantee = AWS::S3::ACL::Grantee.new
grantee.id = '82b82d14a8d011e09d86001cc029a3688cdd635ea8d011e0b499001cc029a3689052a4f4a8d011e0bd25001cc029a368'
grant.grantee = grantee
acl = AWS::S3::S3Object.acl('some/path/to/file', 'somebucket')
acl.grants << grant
AWS::S3::S3Object.acl 'some/path/to/file', 'somebucket', acl
However that does not work, I get the following error:
The XML you provided was not well-formed or did not validate against our published schema (AWS::S3::MalformedACLError)
Any ideas how to make this work?