问题
I am working on an application that has several custom roles that do not map to the existing IAM roles or permissions. e.g. Sales Department, Administrator, or Approver.
I would like to create these custom roles in IAM and assign users to them. However, in order to create a custom role, I need to select at least one permission from the list of predefined permissions.
Is there a way to create a custom role with no permissions or with a minimal permission that has no side effects?
回答1:
You may create roles with no permissions:
Request
POST https://iam.googleapis.com/v1/projects/[[PROJECT-ID]]/roles
{
"role": {
},
"roleId": "test"
}
Response
200
- Show headers -
{
"name": "projects/[[PROJECT-ID]]/roles/test",
"etag": "BwWEuBNyx4k="
}
来源:https://stackoverflow.com/questions/55270838/create-a-custom-role-with-no-or-minimal-permissions