## ListProjectPolicies `client.Projects.Policies.List(ctx, params) (*PoliciesPage[ProjectPolicy], error)` **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. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` ### Parameters - `params ProjectPolicyListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Pagination param.Field[ProjectPolicyListParamsPagination]` Body param: pagination contains the pagination options for listing project policies - `Token string` Token for the next set of results that was returned as next_token of a PaginationResponse - `PageSize int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `ProjectID param.Field[string]` Body param: project_id specifies the project identifier ### Returns - `type ProjectPolicy struct{…}` - `GroupID string` - `Role ProjectRole` role is the role assigned to the group - `const ProjectRoleUnspecified ProjectRole = "PROJECT_ROLE_UNSPECIFIED"` - `const ProjectRoleAdmin ProjectRole = "PROJECT_ROLE_ADMIN"` - `const ProjectRoleUser ProjectRole = "PROJECT_ROLE_USER"` - `const ProjectRoleEditor ProjectRole = "PROJECT_ROLE_EDITOR"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Projects.Policies.List(context.TODO(), gitpod.ProjectPolicyListParams{ Pagination: gitpod.F(gitpod.ProjectPolicyListParamsPagination{ PageSize: gitpod.F(int64(20)), }), ProjectID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "policies": [ { "groupId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "role": "PROJECT_ROLE_UNSPECIFIED" } ] } ```