校验策略是否有新访问权限
功能介绍
校验策略是否有新访问权限。
URI
POST /v5/policies/check-no-new-access
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
existing_policy_document |
是 |
String |
该策略JSON格式策略文档。 |
new_policy_document |
是 |
String |
该策略JSON格式策略文档。 |
policy_type |
是 |
String |
要校验的策略类型。
|
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
message |
String |
更新后的策略是否允许新访问权限的消息。 |
check_result |
String |
检查新访问权限的结果。
|
reasons |
Array of CheckNoNewAccessReason objects |
新增action的statement描述。 |
请求示例
校验策略是否有新访问权限。
POST https://{hostname}/v5/policies/check-no-new-access { "existing_policy_document" : "{\\\"Version\\\":\\\"5.0\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\\":[\\\"iam:users:createUserV5\\\"]}]}", "new_policy_document" : "{\\\"Version\\\":\\\"5.0\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\\":[\\\"iam:users:createUserV5\\\",\\\"obs:bucket:createBucket\\\"]}]}", "policy_type" : "identity_policy" }
响应示例
状态码:200
OK
{ "check_result" : "fail", "message" : "The modified permissions grant new access compared to your existing policy.", "reasons" : [ { "description" : "New access in the statement with sid: {statement_sid}.", "statement_index" : 0, "statement_id" : "{statement_sid}" } ] }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
错误码
请参见错误码。