ListProjectPolicies
client.projects.policies.list(PolicyListParams { token, pageSize, pagination, projectId } params, RequestOptionsoptions?): PoliciesPage<ProjectPolicy { groupId, role } >
POST/gitpod.v1.ProjectService/ListProjectPolicies
Lists policies for a project.
Use this method to:
- View access controls
- Check policy configurations
- Audit permissions
Examples
-
List policies:
Shows all policies for a project.
projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20
ListProjectPolicies
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const projectPolicy of client.projects.policies.list({
pagination: { pageSize: 20 },
projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047',
})) {
console.log(projectPolicy.groupId);
}{
"pagination": {
"nextToken": "nextToken"
},
"policies": [
{
"groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"role": "PROJECT_ROLE_UNSPECIFIED"
}
]
}Returns Examples
{
"pagination": {
"nextToken": "nextToken"
},
"policies": [
{
"groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"role": "PROJECT_ROLE_UNSPECIFIED"
}
]
}