Policy
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
JSON 表示法 |
{
"assignments": [
{
object (Assignment )
}
],
"etag": string
} |
字段 |
assignments[] |
object (Assignment )
|
etag |
string (bytes format)
[etag] 用于乐观并发控制,可帮助防止同时对政策进行的更新相互覆盖。强烈建议系统在读取-修改-写入周期中使用 [etag] 来执行政策更新,以避免出现竞态条件:[policies.get] 的响应中会返回 [etag],系统应将该 etag 放入 [policies.set] 的请求中,以确保其更改将应用于同一版本的政策。 如果在调用 [policies.set] 时未提供 [etag],则现有政策将被覆盖而毫无提示。 使用 base64 编码的字符串。
|
作业
JSON 表示法 |
{
"role": string,
"members": [
string
]
} |
字段 |
role |
string
必需。分配给 members 的角色。
|
members[] |
string
角色所分配到的身份。它可以具有以下值:
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[[["Defines an access control policy for resources, associating members with roles for resource access."],["Policies utilize an `etag` for optimistic concurrency control, preventing overwrites during updates."],["Assignments within a policy link `members` (users or groups) to specific `roles`."],["`members` can be individual Google accounts or Google groups, specified by their email addresses."]]],["The core content defines an access control policy using JSON. A policy contains `assignments` and an `etag` for concurrency control. `Assignments` associate `members` (users or groups identified by email) with a `role`. Systems are advised to use the `etag` from `policies.get` in `policies.set` requests to avoid overwriting changes; otherwise, the existing policy will be blindly overwritten. Policies can contain multiple assignments specifying different members and roles.\n"]]