-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: When moving a file, allow keeping old ACL #21
Comments
From @SimenB on May 3, 2017 14:8 I suppose a workaround is to change the ACL after moving the file. The code doing the rename lives in a project which tries to just pass through options to the storage api though. So passing some custom predefined ACL (which defeats the purpose of the nice The thing we do to avoid it is setting the default ACL of the entire bucket public. Which is fine (in our case), but not ideal. |
From @stephenplusplus on May 3, 2017 14:8 Adding the file.interceptors.push({
request: function(reqOpts) {
if (reqOpts.uri.includes('rewriteTo')) {
reqOpts.qs.destinationPredefinedAcl = '{{predefined acl value}}'
}
return reqOpts
}
}) The incoming reqOpts that you'd be modifying are defined here in the |
Could anyone suggest how we should implement this? After the file is copied, do we call https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/list and then make as many calls as necessary to https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls/insert on the new file? Or is there a way to determine the correct value for |
This came up in Python GCS client library and after speaking with a GCS team member. I decided to close the feature request for the following two reasons: (ref)
|
From @SimenB on May 3, 2017 13:59
Environment details
@google-cloud/storage@1.1.0
Steps to reproduce
@google-cloud/storage
bucket
const file = await bucket.upload(filePath, { public: true })
file.move(somewhere)
What I want is either:
gsutil mv -p
flag, which "Causes ACLs to be preserved when copying in the cloud."file.move(newName, { keepAcl: true })
or something like thatdestinationPredefinedAcl
to themove
methodCopied from original issue: googleapis/google-cloud-node#2274
The text was updated successfully, but these errors were encountered: