Trả về các quyền mà phương thức gọi có trên tài nguyên được chỉ định. Nếu tài nguyên không tồn tại, thì thao tác này sẽ trả về một tập hợp quyền trống, chứ không phải lỗi NOT_FOUND.
Lưu ý: Thao tác này được thiết kế để dùng cho việc tạo giao diện người dùng nhận biết quyền và các công cụ dòng lệnh, chứ không phải để kiểm tra quyền. Thao tác này có thể "không mở được" mà không có cảnh báo.
Yêu cầu HTTP
POST https://cloudaicompanion.googleapis.com/v1/{resource=projects/*/locations/*/codeRepositoryIndexes/*/repositoryGroups/*}:testIamPermissions
BẮT BUỘC: Tài nguyên mà bạn đang yêu cầu thông tin chi tiết về chính sách. Hãy xem phần Tên tài nguyên để biết giá trị thích hợp cho trường này.
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON
{"permissions": [string]}
Các trường
permissions[]
string
Tập hợp các quyền cần kiểm tra cho resource. Không được phép sử dụng các quyền có ký tự đại diện (chẳng hạn như * hoặc storage.*). Để biết thêm thông tin, hãy xem bài viết Tổng quan về IAM.
Nội dung phản hồi
Thông báo phản hồi cho phương thức repositoryGroups.testIamPermissions.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON
{"permissions": [string]}
Các trường
permissions[]
string
Một tập hợp con của TestPermissionsRequest.permissions mà phương thức gọi được phép.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Khó hiểu","hardToUnderstand","thumb-down"],["Thông tin hoặc mã mẫu không chính xác","incorrectInformationOrSampleCode","thumb-down"],["Thiếu thông tin/mẫu tôi cần","missingTheInformationSamplesINeed","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-09 UTC."],[[["This endpoint (`testIamPermissions`) retrieves the permissions a caller has on a specified resource, returning an empty set if the resource doesn't exist."],["The HTTP request is a `POST` method to a URL with the format `https://cloudaicompanion.googleapis.com/v1/{resource=projects/*/locations/*/codeRepositoryIndexes/*/repositoryGroups/*}:testIamPermissions` and utilizes gRPC Transcoding syntax."],["The request body includes a list of `permissions` (strings) to check for the specified `resource`, excluding those with wildcards."],["The response body contains a list of `permissions` (strings) that the caller is allowed, which is a subset of the permissions in the request."],["Authorization for this operation requires the `https://www.googleapis.com/auth/cloud-platform` OAuth scope."]]],[]]