UnshareResourceWithPrincipal
client.groups.shares.delete(ShareDeleteParams { principal, principalId, resourceId, resourceType } body, RequestOptionsoptions?): ShareDeleteResponse
POST/gitpod.v1.GroupService/UnshareResourceWithPrincipal
Removes direct access for a principal (user or service account) from a resource.
Use this method to:
- Revoke a principal’s direct access to a resource
- Remove sharing without affecting group-based access
Examples
-
Remove user access from a runner:
Revokes a user’s direct access to a runner.
resourceType: RESOURCE_TYPE_RUNNER resourceId: "d2c94c27-3b76-4a42-b88c-95a85e392c68" principal: PRINCIPAL_USER principalId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
Authorization
Requires admin role on the specific resource.
UnshareResourceWithPrincipal
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const share = await client.groups.shares.delete({
principal: 'PRINCIPAL_USER',
principalId: 'f53d2330-3795-4c5d-a1f3-453121af9c60',
resourceId: 'd2c94c27-3b76-4a42-b88c-95a85e392c68',
resourceType: 'RESOURCE_TYPE_RUNNER',
});
console.log(share);{}Returns Examples
{}