Method: labels.permissions.batchUpdate
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อัปเดตสิทธิ์ป้ายกำกับ หากไม่มีสิทธิ์สำหรับผู้ใช้ที่ระบุ ระบบจะสร้างสิทธิ์ของป้ายกำกับ หรืออัปเดตสิทธิ์ที่มีอยู่ สิทธิ์จะส่งผลต่อทรัพยากรป้ายกำกับโดยรวม ไม่มีการแก้ไข และไม่จำเป็นต้องเผยแพร่
คำขอ HTTP
POST https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions:batchUpdate
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
parent |
string
ต้องระบุ ชื่อทรัพยากรของป้ายกำกับหลักที่สิทธิ์ทั้งหมดที่กำลังอัปเดตแชร์ รูปแบบ: labels/{label} หากตั้งค่านี้ไว้ ช่องระดับบนสุดในข้อความ UpdateLabelPermissionRequest ต้องว่างเปล่าหรือตรงกับช่องนี้
|
เนื้อความของคำขอ
เนื้อหาของคำขอมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"requests": [
{
object (UpdateLabelPermissionRequest )
}
],
"useAdminAccess": boolean
} |
ช่อง |
requests[] |
object (UpdateLabelPermissionRequest )
ต้องระบุ ข้อความคำขอที่ระบุทรัพยากรที่จะอัปเดต
|
useAdminAccess |
boolean
ตั้งค่าเป็น true เพื่อใช้ข้อมูลเข้าสู่ระบบผู้ดูแลระบบของผู้ใช้ เซิร์ฟเวอร์จะยืนยันว่าผู้ใช้เป็นผู้ดูแลระบบของป้ายกำกับก่อนที่จะอนุญาตให้เข้าถึง หากตั้งค่านี้ไว้ ช่อง useAdminAccess ในข้อความ UpdateLabelPermissionRequest ต้องว่างเปล่าหรือตรงกับช่องนี้
|
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ BatchUpdateLabelPermissionsResponse
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต OAuth อย่างใดอย่างหนึ่งต่อไปนี้
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
ดูข้อมูลเพิ่มเติมได้ที่คู่มือการให้สิทธิ์
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-05 UTC
[null,null,["อัปเดตล่าสุด 2025-08-05 UTC"],[],[],null,["# Method: labels.permissions.batchUpdate\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates label permissions. If a permission for the indicated principal doesn't exist, a label permission is created, otherwise the existing permission is updated. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.\n\n### HTTP request\n\n`POST https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions:batchUpdate`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent label resource name shared by all permissions being updated. Format: `labels/{label}`. If this is set, the parent field in the `UpdateLabelPermissionRequest` messages must either be empty or match this field. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------|\n| ``` { \"requests\": [ { object (`UpdateLabelPermissionRequest`) } ], \"useAdminAccess\": boolean } ``` |\n\n| Fields ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requests[]` | `object (``UpdateLabelPermissionRequest``)` Required. The request message specifying the resources to update. |\n| `useAdminAccess` | `boolean` Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access. If this is set, the `useAdminAccess` field in the `UpdateLabelPermissionRequest` messages must either be empty or match this field. |\n\n### Response body\n\nIf successful, the response body contains an instance of [BatchUpdateLabelPermissionsResponse](/workspace/drive/labels/reference/rest/v2/BatchUpdateLabelPermissionsResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive.labels`\n- `\n https://www.googleapis.com/auth/drive.admin.labels`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]