Method: permissions.list
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Liệt kê các quyền đối với một tệp hoặc bộ nhớ dùng chung.
Yêu cầu HTTP
GET https://www.googleapis.com/drive/v2/files/{fileId}/permissions
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
fileId |
string
Mã nhận dạng của tệp hoặc bộ nhớ dùng chung.
|
Tham số truy vấn
Thông số |
maxResults |
integer
Số lượng quyền tối đa cần trả về trên mỗi trang. Nếu không được đặt cho các tệp trong bộ nhớ dùng chung, thì tối đa 100 kết quả sẽ được trả về. Khi không được đặt cho các tệp không nằm trong bộ nhớ dùng chung, toàn bộ danh sách sẽ được trả về.
|
pageToken |
string
Mã thông báo để tiếp tục yêu cầu danh sách trước đó trên trang tiếp theo. Bạn nên đặt giá trị này thành giá trị của nextPageToken trong phản hồi trước đó.
|
supportsAllDrives |
boolean
Liệu ứng dụng yêu cầu có hỗ trợ cả Drive của tôi và bộ nhớ dùng chung hay không.
|
supportsTeamDrives (deprecated) |
boolean
Không dùng nữa: Thay vào đó, hãy sử dụng supportsAllDrives .
|
useDomainAdminAccess |
boolean
Đưa ra yêu cầu với tư cách là quản trị viên miền; nếu được đặt thành true, thì người yêu cầu sẽ được cấp quyền truy cập nếu tham số mã tệp đề cập đến một bộ nhớ dùng chung và người yêu cầu là quản trị viên của miền mà bộ nhớ dùng chung thuộc về.
|
includePermissionsForView |
string
Chỉ định những quyền xem bổ sung cần đưa vào phản hồi. Chỉ hỗ trợ published .
|
Nội dung yêu cầu
Nội dung yêu cầu phải trống.
Nội dung phản hồi
Danh sách các quyền liên kết với một tệp.
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 |
{
"items": [
{
object (Permission )
}
],
"nextPageToken": string,
"kind": string,
"etag": string,
"selfLink": string
} |
Trường |
items[] |
object (Permission )
Danh sách quyền.
|
nextPageToken |
string
Mã thông báo trang cho trang quyền tiếp theo. Trường này sẽ không xuất hiện nếu bạn đã đến cuối danh sách quyền. Nếu mã thông báo bị từ chối vì bất kỳ lý do nào, mã thông báo đó sẽ bị loại bỏ và việc phân trang sẽ được bắt đầu lại từ trang kết quả đầu tiên.
|
kind |
string
Trạng thái này luôn là drive#permissionList .
|
etag |
string
ETag của danh sách.
|
selfLink |
string
Đường liên kết quay lại danh sách này.
|
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.meet.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.readonly
Một số phạm vi bị hạn chế và yêu cầu bạn phải đánh giá bảo mật để ứng dụng của bạn có thể sử dụng các phạm vi đó. Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Method: permissions.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.PermissionList.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nLists a file's or shared drive's permissions.\n\n### HTTP request\n\n`GET https://www.googleapis.com/drive/v2/files/{fileId}/permissions`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------|\n| `fileId` | `string` The ID for the file or shared drive. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxResults` | `integer` The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned. |\n| `pageToken` | `string` The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from the previous response. |\n| `supportsAllDrives` | `boolean` Whether the requesting application supports both My Drives and shared drives. |\n| `supportsTeamDrives` **(deprecated)** | `boolean` Deprecated: Use `supportsAllDrives` instead. |\n| `useDomainAdminAccess` | `boolean` Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs. |\n| `includePermissionsForView` | `string` Specifies which additional view's permissions to include in the response. Only `published` is supported. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nA list of permissions associated with a file.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"items\": [ { object (/workspace/drive/api/reference/rest/v2/permissions#Permission) } ], \"nextPageToken\": string, \"kind\": string, \"etag\": string, \"selfLink\": string } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `items[]` | `object (`[Permission](/workspace/drive/api/reference/rest/v2/permissions#Permission)`)` The list of permissions. |\n| `nextPageToken` | `string` The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. |\n| `kind` | `string` This is always `drive#permissionList`. |\n| `etag` | `string` The ETag of the list. |\n| `selfLink` | `string` A link back to this list. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/docs`\n- `\n https://www.googleapis.com/auth/drive`\n- `\n https://www.googleapis.com/auth/drive.file`\n- `\n https://www.googleapis.com/auth/drive.meet.readonly`\n- `\n https://www.googleapis.com/auth/drive.metadata`\n- `\n https://www.googleapis.com/auth/drive.metadata.readonly`\n- `\n https://www.googleapis.com/auth/drive.photos.readonly`\n- `\n https://www.googleapis.com/auth/drive.readonly`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]