Method: labels.permissions.batchUpdate
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Memperbarui izin label. Jika izin untuk prinsipal yang ditunjukkan tidak ada, izin label akan dibuat, atau izin yang ada akan diperbarui. Izin memengaruhi resource label secara keseluruhan, tidak direvisi, dan tidak memerlukan publikasi.
Permintaan HTTP
POST https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions:batchUpdate
URL menggunakan sintaksis gRPC Transcoding.
Parameter jalur
Parameter |
parent |
string
Wajib. Nama resource label induk yang digunakan bersama oleh semua izin yang diperbarui. Format: labels/{label} . Jika disetel, kolom induk dalam pesan UpdateLabelPermissionRequest harus kosong atau cocok dengan kolom ini.
|
Isi permintaan
Isi permintaan memuat data dengan struktur berikut:
Representasi JSON |
{
"requests": [
{
object (UpdateLabelPermissionRequest )
}
],
"useAdminAccess": boolean
} |
Kolom |
requests[] |
object (UpdateLabelPermissionRequest )
Wajib. Pesan permintaan yang menentukan resource yang akan diperbarui.
|
useAdminAccess |
boolean
Setel ke true untuk menggunakan kredensial admin pengguna. Server akan memverifikasi bahwa pengguna adalah admin untuk label sebelum mengizinkan akses. Jika ditetapkan, kolom useAdminAccess dalam pesan UpdateLabelPermissionRequest harus kosong atau cocok dengan kolom ini.
|
Isi respons
Jika berhasil, isi respons memuat instance BatchUpdateLabelPermissionsResponse
.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
Untuk mengetahui informasi selengkapnya, lihat Panduan otorisasi.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-05 UTC.
[null,null,["Terakhir diperbarui pada 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)."]]