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.