Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share just one folder (not entire bucket) in Google Cloud Storage?

How can I share a folder from a bucket (not entire bucket) with some users in Google Cloud Storage?

like image 468
Ricardo Avatar asked Jun 16 '14 13:06

Ricardo


2 Answers

You can use gsutil to recursively apply an ACL to a prefix in your bucket. For example, using the acl ch command:

gsutil -m acl ch -r -u [email protected]:READ gs://bucket/prefix/

Note that new objects will not have the ACL applied. If you use a separate bucket, you could set the default object ACL of the bucket to contain your desired ACL, but default ACL's apply to the entire bucket. There is no way to set a default ACL for a specific prefix of the bucket.

like image 82
jterrace Avatar answered Sep 30 '22 18:09

jterrace


Unfortunately you cannot share a folder. As explained in Google's documentation, folders do not really exist in Cloud Storage. It is only a convenient way to display files that contain "/".

As a consequence, you cannot set a permissions for folders.

like image 37
David Avatar answered Sep 30 '22 18:09

David