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 表示法
{
  "nextPageToken": string,
  "kind": string,
  "etag": string,
  "selfLink": string,
  "items": [
    {
      object (Permission)
    }
  ]
}
欄位
nextPageToken

string

下一頁權限的頁面符記。如果已到達權限清單的結尾,這個欄位就會消失。如果符記因任何原因遭到拒絕,則應將其捨棄,並從第一頁結果重新開始分頁。

kind

string

這個值一律為 drive#permissionList

etag

string

清單的 ETag。

items[]

object (Permission)

權限清單。

授權範圍

需要下列其中一種 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

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