Policy
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.
Xác định một chính sách kiểm soát quyền truy cập vào các tài nguyên.
Biểu diễn dưới dạng JSON |
{
"assignments": [
{
object (Assignment )
}
],
"etag": string
} |
Trường |
assignments[] |
object (Assignment )
Danh sách assignments
|
etag |
string (bytes format)
etag được dùng để kiểm soát tính đồng thời lạc quan như một cách giúp ngăn chặn các bản cập nhật đồng thời của một chính sách ghi đè lẫn nhau. Các hệ thống nên sử dụng etag trong chu kỳ đọc-sửa đổi-ghi để thực hiện các bản cập nhật chính sách nhằm tránh tình trạng xung đột: Etag được trả về trong phản hồi cho policies.get và các hệ thống dự kiến sẽ đặt etag đó trong yêu cầu đối với policies.set để đảm bảo rằng thay đổi của chúng sẽ được áp dụng cho cùng một phiên bản của chính sách. Nếu không có etag nào được cung cấp trong lệnh gọi đến policies.get , thì chính sách hiện có sẽ bị ghi đè một cách mù quáng. Một chuỗi được mã hoá base64.
|
Assignment
Liên kết members
với một role
.
Biểu diễn dưới dạng JSON |
{
"role": string,
"members": [
string
]
} |
Trường |
role |
string
Bắt buộc. Vai trò được chỉ định cho members .
|
members[] |
string
Danh tính được chỉ định vai trò. Thuộc tính này có thể có các giá trị sau:
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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`. |"]]