Method: labels.permissions.batchUpdate
更新標籤權限。如果指定的主體沒有權限,系統會建立新的標籤權限;否則,系統會更新現有權限。權限會影響標籤整體資源、未經修訂,且不需要發布。
HTTP 要求
POST https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions:batchUpdate
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
parent |
string
必要欄位。要更新的所有權限共用的父項標籤資源名稱。Format: labels/{label} 如果設定這個項目,UpdateLabelPermissionRequest 訊息中的上層欄位必須為空白或符合這個欄位。
|
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"requests": [
{
object (UpdateLabelPermissionRequest )
}
],
"useAdminAccess": boolean
} |
欄位 |
requests[] |
object (UpdateLabelPermissionRequest )
必要欄位。用於指定要更新資源的要求訊息。
|
useAdminAccess |
boolean
如要使用使用者的管理員憑證,請設為 true 。伺服器會在授予存取權前,確認使用者是否為標籤的管理員。如果設定了這項設定,UpdateLabelPermissionRequest 訊息中的 useAdminAccess 欄位就必須為空白或符合這個欄位。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-10-11 (世界標準時間)。
[null,null,["上次更新時間:2024-10-11 (世界標準時間)。"],[[["Updates permissions for a Label, creating new ones if they don't exist and updating existing ones otherwise."],["Permissions apply to the entire Label resource, are not versioned, and don't need publishing."],["The request body should contain an array of `UpdateLabelPermissionRequest` objects and a `useAdminAccess` boolean."],["Requires authorization with either `https://www.googleapis.com/auth/drive.labels` or `https://www.googleapis.com/auth/drive.admin.labels` scopes."],["Successful responses return a `BatchUpdateLabelPermissionsResponse` object."]]],["This content describes updating Label permissions via a `POST` request to `https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions:batchUpdate`. The `parent` path parameter specifies the Label resource. The request body, in JSON format, includes an array of `UpdateLabelPermissionRequest` objects in `requests` and `useAdminAccess` field that allows using the admin credentials. The response is a `BatchUpdateLabelPermissionsResponse`. This action requires specific OAuth scopes: `drive.labels` or `drive.admin.labels`.\n"]]