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 tắc kiểm soát quyền truy cập.
Thử ngay.
Yêu cầu
Yêu cầu HTTP
PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/acl/ruleId
Thông số
Tên thông số
Giá trị
Mô tả
Tham số đường dẫn
calendarId
string
Giá trị nhận dạng lịch. Để truy xuất mã lịch, hãy gọi phương thức calendarList.list. Nếu bạn muốn truy cập vào lịch chính của người dùng hiện đã đăng nhập, hãy sử dụng từ khoá "primary".
ruleId
string
Giá trị nhận dạng quy tắc ACL.
Thông số truy vấn không bắt buộc
sendNotifications
boolean
Liệu có gửi thông báo về thay đổi đối với việc chia sẻ lịch hay không. Xin lưu ý rằng sẽ không có thông báo nào về việc xoá quyền truy cập. Không bắt buộc. Giá trị mặc định là True.
Ủy quyền
Yêu cầu này yêu cầu uỷ quyền với ít nhất một trong các phạm vi sau:
"default" – Phạm vi công khai. Đây là giá trị mặc định.
"user" – Giới hạn phạm vi ở một người dùng.
"group" – Giới hạn phạm vi ở một nhóm.
"domain" – Giới hạn phạm vi ở một miền.
Lưu ý: Các quyền được cấp cho phạm vi "default" hoặc công khai áp dụng cho mọi người dùng, dù đã xác thực hay chưa.
Thuộc tính không bắt buộc
role
string
Vai trò được chỉ định cho phạm vi. Các giá trị có thể có là:
"none" – Không cấp quyền truy cập.
"freeBusyReader" – Cấp quyền đọc thông tin về lịch trống/bận.
"reader" – Cung cấp quyền đọc vào lịch. Sự kiện riêng tư sẽ xuất hiện với những người dùng có quyền đọc, nhưng thông tin chi tiết về sự kiện sẽ bị ẩn.
"writer" – Cung cấp quyền đọc và ghi vào lịch. Sự kiện riêng tư sẽ xuất hiện với những người dùng có quyền truy cập của người viết và họ sẽ thấy thông tin chi tiết về sự kiện. Cung cấp quyền đọc đối với ACL của lịch.
"owner" – Cung cấp quyền sở hữu lịch. Vai trò này có tất cả các quyền của vai trò người ghi, đồng thời có thêm khả năng thao tác với ACL.
writable
scope.value
string
Địa chỉ email của người dùng hoặc nhóm hoặc tên của miền, tuỳ thuộc vào loại phạm vi. Bỏ qua đối với loại "default".
writable
Phản hồi
Nếu thành công, phương thức này sẽ trả về một tài nguyên Acl trong phần nội dung phản hồi.
Hãy dùng thử!
Sử dụng Trình khám phá API bên dưới để gọi phương thức này trên dữ liệu trực tiếp và xem phản hồi.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Acl: update\n\n| **Note:** Requires [authorization](#auth).\n\nUpdates an access control rule.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPUT https://www.googleapis.com/calendar/v3/calendars/calendarId/acl/ruleId\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|---------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Path parameters** |||\n| `calendarId` | `string` | Calendar identifier. To retrieve calendar IDs call the [calendarList.list](/workspace/calendar/api/v3/reference/calendarList/list) method. If you want to access the primary calendar of the currently logged in user, use the \"`primary`\" keyword. |\n| `ruleId` | `string` | ACL rule identifier. |\n| **Optional query parameters** |||\n| `sendNotifications` | `boolean` | Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. |\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes:\n\n| Scope |\n|-------------------------------------------------|\n| `https://www.googleapis.com/auth/calendar` |\n| `https://www.googleapis.com/auth/calendar.acls` |\n\nFor more information, see the [authentication and authorization](/workspace/guides/configure-oauth-consent) page.\n\n### Request body\n\nIn the request body, supply an [Acl resource](/workspace/calendar/api/v3/reference/acl#resource) with the following properties:\n\n| Property name | Value | Description | Notes |\n|---------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|\n| **Required Properties** ||||\n| `scope` | `object` | The extent to which [calendar access](https://developers.google.com/workspace/calendar/concepts/sharing#sharing_calendars) is granted by this ACL rule. | |\n| scope.`type` | `string` | The type of the scope. Possible values are: - \"`default`\" - The public scope. This is the default value. - \"`user`\" - Limits the scope to a single user. - \"`group`\" - Limits the scope to a group. - \"`domain`\" - Limits the scope to a domain. Note: The permissions granted to the \"`default`\", or public, scope apply to any user, authenticated or not. | |\n| **Optional Properties** ||||\n| `role` | `string` | The role assigned to the scope. Possible values are: - \"`none`\" - Provides no access. - \"`freeBusyReader`\" - Provides read access to free/busy information. - \"`reader`\" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. - \"`writer`\" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. Provides read access to the calendar's ACLs. - \"`owner`\" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to manipulate ACLs. | writable |\n| scope.`value` | `string` | The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type \"`default`\". | writable |\n\nResponse\n--------\n\nIf successful, this method returns an [Acl resource](/workspace/calendar/api/v3/reference/acl#resource) in the response body.\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]