Method: permissions.list

列出檔案或共用雲端硬碟的權限。

HTTP 要求

GET https://www.googleapis.com/drive/v2/files/{fileId}/permissions

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
fileId

string

檔案或共用雲端硬碟的 ID。

查詢參數

參數
maxResults

integer

每頁傳回的權限數量上限。如果未針對共用雲端硬碟中的檔案設定,最多會傳回 100 個結果。如果未針對非共用雲端硬碟中的檔案設定,系統會傳回整個清單。

pageToken

string

這個符記可用於在下一頁接續先前的清單要求。這應設為前一個回應中的 nextPageToken 值。

supportsAllDrives

boolean

要求存取的應用程式是否同時支援「我的雲端硬碟」和共用雲端硬碟。

supportsTeamDrives
(deprecated)

boolean

已淘汰:請改用 supportsAllDrives

useDomainAdminAccess

boolean

以網域管理員身分發出要求;如果設為 true,且檔案 ID 參數參照共用雲端硬碟,而要求者是共用雲端硬碟所屬網域的管理員,系統就會授予要求者存取權。

includePermissionsForView

string

指定要在回應中納入哪些額外檢視區塊權限。系統僅支援 published

要求主體

要求主體必須為空白。

回應主體

與檔案相關聯的權限清單。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "items": [
    {
      object (Permission)
    }
  ],
  "nextPageToken": string,
  "kind": string,
  "etag": string,
  "selfLink": string
}
欄位
items[]

object (Permission)

權限清單。

nextPageToken

string

下一頁權限的頁面符記。如果已到達權限清單結尾,則不會顯示這個欄位。如果系統基於任何原因拒絕符記,就應捨棄該符記,並從第一頁結果重新開始分頁。

kind

string

這個值一律為 drive#permissionList

etag

string

清單的 ETag。

授權範圍

需要下列其中一種 OAuth 範圍:

  • 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

部分範圍受到限制,應用程式必須通過安全性評估才能使用。詳情請參閱授權指南