如何设置Google Cloud Storage Bucket文件夹的访问权限 [英] How to set access permissions of google cloud storage bucket folder

查看:530
本文介绍了如何设置Google Cloud Storage Bucket文件夹的访问权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为存储桶中的整个文件夹设置访问权限?例子;我在一个存储桶中有2个文件夹(包含许多子文件夹/对象)(让我们将其称为文件夹"A"和"B"),在项目团队中有4个成员.所有4个成员都可以对文件夹A进行读取/编辑访问,但是只有2个成员可以访问文件夹"B".有没有一种简单的方法可以为每个文件夹设置这些权限?每个文件夹中有成千上万个文件,为每个文件设置权限将非常耗时.谢谢你的帮助.

How do I set access permissions for entire folder in storage bucket? Example; I have 2 folders (containing many subfolders/objects) in single bucket (let's call them folder 'A' and 'B') and 4 members in project team. All 4 members can have read/edit access for folder A but only 2 of the members are allowed to have access to folder 'B'. Is there a simple way to set these permissions for each folder? There are hundreds/thousands of files within each folder and it would be very time consuming to set permissions for each individual file. Thanks for any help.

推荐答案

它的文献资料很少,但是可以在

It's very poorly documented, but search for "folder" in the gsutil acl ch manpage:

授予用户指定的规范ID READ访问实例文件夹中所有以folder/开头的对象的权限:

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/

这篇关于如何设置Google Cloud Storage Bucket文件夹的访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆