Acl: insert
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างกฎการควบคุมการเข้าถึง
ลองใช้เลย
ส่งคำขอ
คำขอ HTTP
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
พารามิเตอร์เส้นทาง |
calendarId |
string |
ตัวระบุปฏิทิน หากต้องการเรียกข้อมูลรหัสปฏิทิน ให้เรียกใช้เมธอด calendarList.list หากต้องการเข้าถึงปฏิทินหลักของผู้ใช้ที่เข้าสู่ระบบอยู่ในปัจจุบัน ให้ใช้คีย์เวิร์ด "primary "
|
พารามิเตอร์การค้นหาที่ไม่บังคับ |
sendNotifications |
boolean |
ตัวเลือกว่าจะส่งการแจ้งเตือนเกี่ยวกับการเปลี่ยนแปลงการแชร์ปฏิทินหรือไม่ ไม่บังคับ ค่าเริ่มต้นคือ True
|
การให้สิทธิ์
คำขอนี้ต้องมีการให้สิทธิ์ด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
ขอบเขต |
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.acls |
ดูข้อมูลเพิ่มเติมได้ที่หน้าการตรวจสอบสิทธิ์และการให้สิทธิ์
เนื้อความของคำขอ
ในเนื้อหาของคำขอ ให้ระบุทรัพยากร Acl ที่มีพร็อพเพอร์ตี้ต่อไปนี้
ชื่อพร็อพเพอร์ตี้ |
ค่า |
คำอธิบาย |
หมายเหตุ |
พร็อพเพอร์ตี้ที่จำเป็น |
role |
string |
บทบาทที่กําหนดให้กับขอบเขต ค่าที่เป็นไปได้มีดังนี้ - "
none " - ไม่มีสิทธิ์เข้าถึง - "
freeBusyReader " - ให้สิทธิ์อ่านข้อมูลว่าง/ไม่ว่าง - "
reader " - ให้สิทธิ์อ่านปฏิทิน กิจกรรมส่วนตัวจะปรากฏต่อผู้ใช้ที่มีสิทธิ์เข้าถึงระดับผู้อ่าน แต่ระบบจะซ่อนรายละเอียดกิจกรรม - "
writer " - ให้สิทธิ์อ่านและเขียนในปฏิทิน กิจกรรมส่วนตัวจะปรากฏต่อผู้ใช้ที่มีสิทธิ์เข้าถึงระดับผู้เขียน และผู้ใช้จะเห็นรายละเอียดกิจกรรม ให้สิทธิ์การอ่าน ACL ของปฏิทิน - "
owner " - ระบุการเป็นเจ้าของปฏิทิน บทบาทนี้มีสิทธิ์ทั้งหมดของบทบาทผู้เขียน พร้อมความสามารถในการจัดการ ACL เพิ่มเติม |
เขียนได้
|
scope |
object |
ระดับที่กฎ ACL นี้ให้สิทธิ์การเข้าถึงปฏิทิน |
|
scope.type |
string |
ประเภทของขอบเขต ค่าที่เป็นไปได้มีดังนี้ - "
default " - ขอบเขตสาธารณะ นี่คือค่าเริ่มต้น - "
user " - จำกัดขอบเขตให้ผู้ใช้รายเดียว - "
group " - จำกัดขอบเขตไว้ที่กลุ่ม - "
domain " - จำกัดขอบเขตไว้ที่โดเมน หมายเหตุ: สิทธิ์ที่มอบให้กับขอบเขต "default " หรือสาธารณะจะมีผลกับผู้ใช้ทุกคนไม่ว่าจะมีการตรวจสอบสิทธิ์หรือไม่ก็ตาม |
|
พร็อพเพอร์ตี้ที่ไม่บังคับ |
scope.value |
string |
อีเมลของผู้ใช้หรือกลุ่ม หรือชื่อโดเมน ทั้งนี้ขึ้นอยู่กับประเภทขอบเขต ละเว้นสำหรับประเภท "default " |
เขียนได้
|
การตอบกลับ
หากดำเนินการสำเร็จ วิธีการนี้จะแสดงผล Acl resource ในเนื้อหาการตอบกลับ
ลองใช้งาน
ใช้โปรแกรมสำรวจ API ด้านล่างเพื่อเรียกใช้เมธอดนี้กับข้อมูลจริงและดูการตอบกลับ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# Acl: insert\n\n| **Note:** Requires [authorization](#auth).\n\nCreates an access control rule.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/calendar/v3/calendars/calendarId/acl\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| **Optional query parameters** |||\n| `sendNotifications` | `boolean` | Whether to send notifications about the calendar sharing change. 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| `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` | `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| 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."]]