กําหนดค่าบทบาท
เอกสารนี้ให้ข้อมูลเกี่ยวกับบทบาทและสิทธิ์ของ Identity and Access Management (IAM) สําหรับการเพิ่มประสิทธิภาพเส้นทาง IAM ช่วยให้คุณให้สิทธิ์เข้าถึงแบบละเอียดแก่ทรัพยากรการเพิ่มประสิทธิภาพเส้นทางที่เฉพาะเจาะจง และช่วยป้องกันไม่ให้เข้าถึงทรัพยากรอื่นๆ IAM ช่วยให้คุณใช้หลักความปลอดภัยของสิทธิ์ขั้นต่ำได้ ซึ่งระบุว่าไม่ควรมีใครมีสิทธิ์มากกว่าที่ตนจําเป็นต้องใช้
เมื่อผู้ใช้หลัก (ผู้ใช้ กลุ่ม หรือบัญชีบริการ) เรียกใช้ Google Cloud API ผู้ใช้หลักนั้นต้องมีสิทธิ์ IAM ที่เหมาะสมในการใช้ทรัพยากร หากต้องการให้ผู้ใช้หลักมีสิทธิ์ที่จําเป็น คุณต้องมอบบทบาท IAM ให้กับผู้ใช้หลัก
หากต้องการทำความคุ้นเคยกับการจัดการการเข้าถึงใน Google Cloud โดยทั่วไป โปรดดูภาพรวม IAM
บทบาท IAM ที่กําหนดไว้ล่วงหน้าเพื่ออนุญาตให้ผู้ใช้หลักเข้าถึงการเพิ่มประสิทธิภาพเส้นทางมีดังนี้
-
Route Optimization Editor (roles/routeoptimization.editor)
: ให้สิทธิ์ผู้ใช้หรือบัญชีบริการอ่านและเขียนแหล่งข้อมูลการเพิ่มประสิทธิภาพเส้นทางในโปรเจ็กต์ ซึ่งรวมถึงความสามารถในการเรียก OptimizeTours
และ BatchOptimizeTours
รวมถึงดึงข้อมูลการดำเนินการที่ทำงานอยู่นานโดยใช้ GetOperation
-
Route Optimization Viewer (roles/routeoptimization.viewer)
: ให้สิทธิ์เข้าถึงระดับอ่านอย่างเดียว
ในแหล่งข้อมูลการเพิ่มประสิทธิภาพเส้นทางในโปรเจ็กต์ บทบาทนี้ช่วยให้สามารถเรียกใช้ OptimizeTours
และเข้าถึงการดำเนินการแบบดำเนินต่อเนื่องได้โดยใช้ GetOperation
คุณสามารถมอบหมายบทบาทได้โดยการสร้างการเชื่อมโยงสำหรับผู้ใช้หลักโดยใช้ Cloud SDK โดยทำดังนี้
gcloud projects add-iam-policy-binding PROJECT \
--member user:someone@example.com \
--role roles/routeoptimization.editor
ดูข้อมูลเพิ่มเติมได้ที่
มอบบทบาท IAM โดยใช้คอนโซล Google Cloud
ขั้นตอนถัดไป
หลังจากกําหนดค่าบทบาทแล้ว คุณต้องสร้างโทเค็น OAuth โดยทำดังนี้
ใช้ OAuth
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-12-03 UTC
[null,null,["อัปเดตล่าสุด 2024-12-03 UTC"],[[["Route Optimization utilizes Identity and Access Management (IAM) to control access to its resources, enabling you to grant specific permissions to users, groups, or service accounts."],["IAM roles like `Route Optimization Editor` and `Route Optimization Viewer` provide predefined permission sets for managing and viewing Route Optimization resources."],["Users or service accounts need appropriate IAM permissions to interact with Google Cloud APIs and use Route Optimization features like `OptimizeTours` and `BatchOptimizeTours`."],["The principle of least privilege is enforced by IAM, ensuring that users have only the necessary permissions for their tasks."],["After role configuration, an OAuth token is required for authentication when using Route Optimization."]]],["IAM roles control access to Route Optimization resources. Principals require appropriate IAM permissions to use Google Cloud APIs. The `Route Optimization Editor` role grants read/write access, including calling `OptimizeTours`, `BatchOptimizeTours`, and `GetOperation`. The `Route Optimization Viewer` role offers read-only access, enabling `OptimizeTours` and `GetOperation`. Roles are assigned to principals through IAM bindings in the Cloud SDK using `gcloud`. After roles are configured, you must create an OAuth token.\n"]]