Skip to content

Ability to easily copy object ACL #1703

Description

In v1 of the SDK, copying over object ACL while copying an object was fairly easy.
Assuming we already had a CopyObjectRequest named req, this was all the additional code that was necessary.

AccessControlList acl = s3.getObjectAcl(bucketName, oldObjectName);
req.setAccessControlList(acl);

Now getObjectAcl returns a GetObjectAclResponse, and CopyObjectRequest only takes canned ACL. There's no way to directly copy it over. It appears I have to manually copy the fields of the GetObjectAclResponse to an AccessControlPolicy, then pass that to a separate PutObjectAclRequest. Not only is this more code, but it isn't very discoverable. It wasn't obvious how to go from a GetObjectAclResponse to something that could be set on another object.

I'd like there to be an easier way to copy ACL over when copying an S3 object using the v2 SDK.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions