CreateRoleAssignment
POST/gitpod.v1.GroupService/CreateRoleAssignment
Creates a role assignment for a group on a resource.
Use this method to:
- Assign specific roles to groups on runners, projects, or environments
- Grant group-based access to resources
Examples
-
Assign admin role on a runner:
Grants the group admin access to a runner.
groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" resourceType: RESOURCE_TYPE_RUNNER resourceId: "f53d2330-3795-4c5d-a1f3-453121af9c60" resourceRole: RESOURCE_ROLE_RUNNER_ADMIN -
Assign user role on a project:
Grants the group user access to a project.
groupId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" resourceType: RESOURCE_TYPE_PROJECT resourceId: "a1b2c3d4-5678-90ab-cdef-1234567890ab" resourceRole: RESOURCE_ROLE_PROJECT_USER
Authorization
Requires admin role on the specific resource.
CreateRoleAssignment
curl https://app.gitpod.io/api/gitpod.v1.GroupService/CreateRoleAssignment \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $GITPOD_API_KEY" \
-d '{}'{
"assignment": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"derivedFromOrgRole": "RESOURCE_ROLE_UNSPECIFIED",
"groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"resourceId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"resourceRole": "RESOURCE_ROLE_UNSPECIFIED",
"resourceType": "RESOURCE_TYPE_UNSPECIFIED"
}
}Returns Examples
{
"assignment": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"derivedFromOrgRole": "RESOURCE_ROLE_UNSPECIFIED",
"groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"resourceId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"resourceRole": "RESOURCE_ROLE_UNSPECIFIED",
"resourceType": "RESOURCE_TYPE_UNSPECIFIED"
}
}