Home > Software design >  Is there a way to get the canned ACL of an existing S3 object?
Is there a way to get the canned ACL of an existing S3 object?

Time:12-16

I'm trying to copy an existing object from one key to another in the same bucket.

I'd like to get the canned ACL e.g. "private"|"public-read"|"public-read-write"|"authenticated-read"|"aws-exec-read"|"bucket-owner-read"|"bucket-owner-full-control" so that I can then apply this to the new object.

What's the best way to do this using the Node.js SDK?

CodePudding user response:

You can call getObjectAcl() to obtain the ACL on the source object, and then specify that information using putObjectAcl(), or even specify it as part of the copyObject() call.

You won't get the "canned ACL", but you will get the permissions on the object that were created as a result of the original Canned ACL.

  • Related