Policy
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
กำหนดนโยบายควบคุมการเข้าถึงทรัพยากร
การแสดง JSON |
{
"assignments": [
{
object (Assignment )
}
],
"etag": string
} |
ช่อง |
assignments[] |
object (Assignment )
รายการ assignments
|
etag |
string (bytes format)
ระบบใช้ ETag สำหรับการควบคุมการทำงานพร้อมกันแบบมองโลกในแง่ดีเพื่อช่วยป้องกันไม่ให้การอัปเดตนโยบายพร้อมกันเขียนทับกัน เราขอแนะนำอย่างยิ่งให้ระบบใช้ etag ในวงจรการอ่าน-แก้ไข-เขียนเพื่ออัปเดตนโยบายเพื่อหลีกเลี่ยงการแข่งขัน: ระบบจะส่งคืน etag ในการตอบกลับไปยัง policies.get และคาดว่าระบบจะใส่ etag นั้นในคำขอไปยัง policies.set เพื่อให้แน่ใจว่าการเปลี่ยนแปลงจะนำไปใช้กับนโยบายเวอร์ชันเดียวกัน หากไม่ได้ระบุ ETag ในการเรียกใช้ policies.get ระบบจะเขียนทับนโยบายที่มีอยู่โดยไม่ตรวจสอบ สตริงที่เข้ารหัส Base64
|
การมอบหมาย
เชื่อมโยง members
กับ role
การแสดง JSON |
{
"role": string,
"members": [
string
]
} |
ช่อง |
role |
string
ต้องระบุ บทบาทที่มอบหมายให้ members
|
members[] |
string
ข้อมูลประจำตัวที่กำหนดบทบาทให้ โดยอาจมีค่าดังต่อไปนี้
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThis document defines an access control policy for resources, utilizing JSON for representation.\u003c/p\u003e\n"],["\u003cp\u003eThe policy includes assignments which associate members with specific roles.\u003c/p\u003e\n"],["\u003cp\u003eRoles determine the level of access granted to assigned members, which can be individuals or groups.\u003c/p\u003e\n"],["\u003cp\u003eAn \u003ccode\u003eetag\u003c/code\u003e is used for optimistic concurrency control, preventing simultaneous updates from overwriting each other.\u003c/p\u003e\n"]]],["The content defines access control policies for resources using JSON. A policy includes an array of \"assignments\" and an \"etag\" for concurrency control. Assignments link \"members\" to a specified \"role,\" with members being Google account emails or group emails. Systems use the etag in read-modify-write cycles to prevent overwriting. The \"role\" field is a required string, and members represent identities granted the specified role.\n"],null,["# Policy\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Assignment](#Assignment)\n - [JSON representation](#Assignment.SCHEMA_REPRESENTATION)\n\nDefines an access control policy to the resources.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"assignments\": [ { object (/spectrum-access-system/reference/rest/v1alpha1/Policy#Assignment) } ], \"etag\": string } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `assignments[]` | `object (`[Assignment](/spectrum-access-system/reference/rest/v1alpha1/Policy#Assignment)`)` List of [assignments](/spectrum-access-system/reference/rest/v1alpha1/Policy#Assignment) |\n| `etag` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` The etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An etag is returned in the response to [policies.get](/spectrum-access-system/reference/rest/v1alpha1/policies/get#spectrum.sas.portal.v1alpha1.PolicyService.GetPolicy), and systems are expected to put that etag in the request to [policies.set](/spectrum-access-system/reference/rest/v1alpha1/policies/set#spectrum.sas.portal.v1alpha1.PolicyService.SetPolicy) to ensure that their change will be applied to the same version of the policy. If no etag is provided in the call to [policies.get](/spectrum-access-system/reference/rest/v1alpha1/policies/get#spectrum.sas.portal.v1alpha1.PolicyService.GetPolicy), then the existing policy is overwritten blindly. A base64-encoded string. |\n\nAssignment\n----------\n\nAssociates `members` with a `role`.\n\n| JSON representation |\n|---------------------------------------------------|\n| ``` { \"role\": string, \"members\": [ string ] } ``` |\n\n| Fields ||\n|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `role` | `string` Required. Role that is assigned to `members`. |\n| `members[]` | `string` The identities the role is assigned to. It can have the following values: - `{user_email}`: An email address that represents a specific Google account. For example: `alice@gmail.com`. - `{group_email}`: An email address that represents a Google group. For example, `viewers@gmail.com`. |"]]