我可以向项目添加组织级 gcp 自定义角色吗?
Can I add an organization-level gcp Custom Role to a project?
我正在尝试在 Google 云组织中创建一个 Custom Role,然后将该组应用于该组织的一个项目。但是,这似乎不起作用:
$ gcloud projects add-iam-policy-binding \
--member="group:data.viewer@example.com" \
--role="roles/viewer" "my-project"
ERROR: Policy modification failed. For a binding with condition, run "gcloud alpha iam policies lint-condition" to identify issues in condition.
ERROR: (gcloud.projects.add-iam-policy-binding) INVALID_ARGUMENT: Group data.viewer@example.com does not exist.
这是我要分配的组织级角色:
$ gcloud iam roles describe data.viewer --organization 1234567
description: Can View Analytics
etag: ...
name: organizations/1234567/roles/data.viewer
stage: ALPHA
title: Data Viewer
documentation 似乎有待解释:
Custom roles can only be used to grant permissions in policies for the same project or organization that owns the roles or resources under them. You cannot grant custom roles from one project or organization on a resource owned by a different project or organization.
这是否意味着我的自定义角色可以或不能用于该组织内的项目?
我也想知道这是否不是将用户分组并授予他们对各种项目的权限的正确方法。
从上面的错误来看,组data.viewer@example.com似乎不存在。
你能确定这个群组确实存在并且归同一个组织所有吗?
目前,根据云文档 [1],“您无法在文件夹级别创建自定义角色。自定义角色只能用于为拥有其下的角色或资源的同一项目或组织授予政策权限。您不能授予一个项目或组织对另一项目或组织拥有的资源的自定义角色。”请参阅该页上的蓝色注释。
[1] https://cloud.google.com/iam/docs/understanding-custom-roles#basic_concepts
有可能。
您需要指定在项目中的角色为:
organizations/1234567/roles/data.观众
我正在尝试在 Google 云组织中创建一个 Custom Role,然后将该组应用于该组织的一个项目。但是,这似乎不起作用:
$ gcloud projects add-iam-policy-binding \
--member="group:data.viewer@example.com" \
--role="roles/viewer" "my-project"
ERROR: Policy modification failed. For a binding with condition, run "gcloud alpha iam policies lint-condition" to identify issues in condition.
ERROR: (gcloud.projects.add-iam-policy-binding) INVALID_ARGUMENT: Group data.viewer@example.com does not exist.
这是我要分配的组织级角色:
$ gcloud iam roles describe data.viewer --organization 1234567
description: Can View Analytics
etag: ...
name: organizations/1234567/roles/data.viewer
stage: ALPHA
title: Data Viewer
documentation 似乎有待解释:
Custom roles can only be used to grant permissions in policies for the same project or organization that owns the roles or resources under them. You cannot grant custom roles from one project or organization on a resource owned by a different project or organization.
这是否意味着我的自定义角色可以或不能用于该组织内的项目?
我也想知道这是否不是将用户分组并授予他们对各种项目的权限的正确方法。
从上面的错误来看,组data.viewer@example.com似乎不存在。 你能确定这个群组确实存在并且归同一个组织所有吗?
目前,根据云文档 [1],“您无法在文件夹级别创建自定义角色。自定义角色只能用于为拥有其下的角色或资源的同一项目或组织授予政策权限。您不能授予一个项目或组织对另一项目或组织拥有的资源的自定义角色。”请参阅该页上的蓝色注释。
[1] https://cloud.google.com/iam/docs/understanding-custom-roles#basic_concepts
有可能。
您需要指定在项目中的角色为:
organizations/1234567/roles/data.观众