google-cloud-platform - 我可以向项目添加组织级 gcp 自定义角色吗?
问题描述
我正在尝试在 Google Cloud 组织中创建自定义角色,然后将该组应用于该组织的一个项目。但是,这似乎不起作用:
$ 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
该文档似乎可以解释:
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.
这是否意味着我的自定义角色可以或不能在该组织内的项目中使用?
我还想知道这是否不是将用户分组并授予他们对各种项目的权限的正确方法。
解决方案
从上面的错误来看,Group data.viewer@example.com 似乎不存在。你能确定这个组确实存在并且归同一个组织所有吗?
推荐阅读
- c++ - 从父对象c ++访问子方法
- sql-server - 为 30、60、90+ 库存创建 SQL 查询
- mysql - 如何在 GROUP BY 之后从表中获取最小 ID
- c++ - 是否可以反序列化(从原始内存块)没有默认构造函数的对象?
- android - 在单元测试中未按时创建 Rx 一次性
- gulp - 我的代码在 gulp 任务结束后执行
- typescript - 尝试 setState 时出错 - 正在工作。最近更新坏了
- .net - Visual Studio 2019 MVC 项目模板无法编译
- spring-boot - 保护桌面应用程序客户端的 SpringBoot API
- html - 仅使用 CSS 的字体轮廓