1

Trying out a solution to a scenario.

I need to create storage space for 5000 users in an organization in GCP Cloud Storage. Thought of creating one bucket and creating folders inside each user based on their staff number. But how do I restrict access to a folder belonging to a user with the staff number 101(for eg) to himself - nobody else should be able to access this folder other than the employee who owns this. I do understand that in a bucket folder is just a virtual one managed using paths. I do understand that ACL can be used to restrict access at folder level. But could not find out how to achieve this.

Thanks in advance. Suhas

  • It's really simple in AWS, but not so trivial in GCP. You can try something like this gsutil acl ch -r -u user@example.com:W gs://example-bucket/userFolder/ – ALex_hha Aug 15 '18 at 13:10
  • I had tried this, but still mutually exclusive permissions are not achieved. – Suhas Vengilat Aug 28 '18 at 10:46
1

As per document bucket ACL

Example

gsutil acl ch -r -u 12XXXXXXXXXXXXXXXXXXX:R gs://bucket/folder/
| improve this answer | |
  • Thanks Sanjay. My issue is to set write permission to the folder owned by the user, others should not be able to read/write the contents of another folder. Setting Write permission at the folder level seems to be not allowed. – Suhas Vengilat Aug 12 '18 at 11:33
0

Here's a related solution from GCP documentation.

Grant the user with the specified canonical ID READ access to all objects in example-bucket that begin with folder/:

gsutil acl ch -r -u 84fac329bceSAMPLE777d5d22b8SAMPLE785ac2SAMPLE2dfcf7c4adf34da46:R gs://example-bucket/folder/

https://cloud.google.com/storage/docs/gsutil/commands/acl

| improve this answer | |
  • Thanks Pranay, I had come across this command, but could not make out how to generate the Canonical ID READ? I was searching for this in the GCP documentation, couldn't get anywhere. Any pointers on this would be helpful. In the meantime I'm also searching. – Suhas Vengilat Aug 28 '18 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.