Google cloud platform 谷歌云:拒绝访问给定存储桶中的单个文件

Google cloud platform 谷歌云:拒绝访问给定存储桶中的单个文件,google-cloud-platform,google-cloud-storage,google-cloud-iam,Google Cloud Platform,Google Cloud Storage,Google Cloud Iam,假设我有: 一个谷歌云存储桶bucketxyz和两个用户组:group1和group2 另一个第三组alluser,包括group1和group2中的所有用户 然后: 针对bucketxyz的IAM策略,该策略授予alluser的只读访问权限和group1的读/写权限(但无所有权,以避免文件删除) 还可以考虑bucketxyz的两个文件:file_shared.txt和file_restricted.txt,这两种情况: 文件\u shared.txt可以由group1中的某个人编写,但

假设我有:

  • 一个谷歌云存储桶
    bucketxyz
    和两个用户组:
    group1
    group2
  • 另一个第三组
    alluser
    ,包括
    group1
    group2
    中的所有用户
然后:

  • 针对
    bucketxyz
    的IAM策略,该策略授予
    alluser
    的只读访问权限和
    group1
    的读/写权限(但无所有权,以避免文件删除)
还可以考虑bucketxyz的两个文件:
file_shared.txt
file_restricted.txt
,这两种情况:

  • 文件\u shared.txt
    可以由
    group1
    中的某个人编写,但也可以
    group2中的用户只需使用上述IAM策略即可访问。
    -
  • 文件\u restricted.txt
    只能由
    group1
    中的用户编写和访问

  • 是否可以通过在
    bucketxyz
    中为
    文件
    使用专用的ACL规则来实现场景2?如果是,如何进行

    IAM中的权限是同心的,没有“拒绝”的概念,如“子策略不能限制在父策略上授予的访问权限”中所述

    要实现
    group1
    group2
    可以访问
    file\u shared.txt
    但只有
    group2
    可以访问
    file\u restricted.txt
    ,您需要为
    group1
    group2
    授予每个对象的访问权限。或者,您可以在
    bucketxyz
    级别授予
    group2
    读/写访问权限,并向
    group1
    授予每个对象的读访问权限