Method: labels.permissions.batchUpdate
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cập nhật quyền đối với nhãn. Nếu không có quyền nào cho đối tượng chính được chỉ định, thì một quyền về nhãn sẽ được tạo, nếu không, quyền hiện có sẽ được cập nhật. Quyền ảnh hưởng đến toàn bộ tài nguyên nhãn, không được sửa đổi và không cần xuất bản.
Yêu cầu HTTP
POST https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions:batchUpdate
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
parent |
string
Bắt buộc. Tên tài nguyên nhãn mẹ được chia sẻ bởi tất cả các quyền đang được cập nhật. Định dạng: labels/{label} . Nếu bạn đặt trường này, thì trường mẹ trong thông báo UpdateLabelPermissionRequest phải trống hoặc trùng khớp với trường này.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"requests": [
{
object (UpdateLabelPermissionRequest )
}
],
"useAdminAccess": boolean
} |
Trường |
requests[] |
object (UpdateLabelPermissionRequest )
Bắt buộc. Thông báo yêu cầu chỉ định các tài nguyên cần cập nhật.
|
useAdminAccess |
boolean
Đặt thành true để sử dụng thông tin đăng nhập quản trị của người dùng. Máy chủ sẽ xác minh xem người dùng có phải là quản trị viên của nhãn hay không trước khi cho phép truy cập. Nếu bạn đặt trường này, thì trường useAdminAccess trong thông báo UpdateLabelPermissionRequest phải trống hoặc khớp với trường này.
|
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của BatchUpdateLabelPermissionsResponse
.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-05 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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)."]]