方法:projects.locations.testIamPermissions
返回调用者对指定资源拥有的权限。如果资源不存在,则返回一个空权限集,而非返回 NOT_FOUND 错误。
注意:此操作旨在用于构建权限感知型界面和命令行工具,而不是用于授权检查。此操作可能会在没有警告的情况下“应急开启”。
HTTP 请求
POST https://automl.googleapis.com/v1beta1/{resource}:testIamPermissions
路径参数
参数 |
resource |
string
必需字段:要为其请求政策的资源。如需了解此字段的适当值,请参阅操作文档。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"permissions": [
string
]
} |
字段 |
permissions[] |
string
要用于检查 resource 的权限集。不允许使用带通配符(例如“*”或“storage.*”)的权限。如需了解详情,请参阅 IAM 概览。
|
响应正文
如果成功,响应正文将包含结构如下的数据:
locations.testIamPermissions
方法的响应消息。
JSON 表示法 |
{
"permissions": [
string
]
} |
字段 |
permissions[] |
string
调用者拥有的 TestPermissionsRequest.permissions 的子集。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/cloud-platform
如需了解详情,请参阅身份验证概览。
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2019-03-13 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"很难理解"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"信息或示例代码不正确"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"没有我需要的信息/示例"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]