Method: labels.permissions.create
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
อัปเดตสิทธิ์ของป้ายกำกับ หากไม่มีสิทธิ์สำหรับผู้ใช้ที่ระบุ ระบบจะสร้างสิทธิ์ของป้ายกำกับ หรืออัปเดตสิทธิ์ที่มีอยู่ สิทธิ์จะส่งผลต่อทรัพยากรป้ายกำกับโดยรวม ไม่มีการแก้ไข และไม่จำเป็นต้องเผยแพร่
คำขอ HTTP
POST https://drivelabels.googleapis.com/v2/{parent=labels/*}/permissions
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
parent |
string
ต้องระบุ สร้างชื่อทรัพยากรของป้ายกำกับระดับบนสุดในสิทธิ์ของป้ายกำกับ รูปแบบ: labels/{label}
|
พารามิเตอร์การค้นหา
พารามิเตอร์ |
useAdminAccess |
boolean
ตั้งค่าเป็น true เพื่อใช้ข้อมูลเข้าสู่ระบบผู้ดูแลระบบของผู้ใช้ เซิร์ฟเวอร์จะยืนยันว่าผู้ใช้เป็นผู้ดูแลระบบของป้ายกำกับก่อนที่จะอนุญาตให้เข้าถึง
|
เนื้อความของคำขอ
เนื้อความของคำขอมีอินสแตนซ์ของ LabelPermission
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ LabelPermission
ที่สร้างขึ้นใหม่
ขอบเขตการให้สิทธิ์
ต้องใช้ขอบเขต 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.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nUpdates a label's 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`\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 on the label permission is created. Format: `labels/{label}`. |\n\n### Query parameters\n\n| Parameters ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\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. |\n\n### Request body\n\nThe request body contains an instance of [LabelPermission](/workspace/drive/labels/reference/rest/v2/labels.permissions#LabelPermission).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [LabelPermission](/workspace/drive/labels/reference/rest/v2/labels.permissions#LabelPermission).\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)."]]