接口描述

列出指定用户被授予的授权策略

请求参数

Action
  • 类型:String
  • 必须:是
  • 描述:系统规定参数,取值:ListPoliciesForUser
UserName
  • 类型:String
  • 必须:是
  • 描述:指定用户名。例:zhangqiang

返回参数

Policies
  • 类型:Policy Array
  • 描述:授权策略名称列表

错误信息

InvalidParameter.UserName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - "UserName" contains invalid chars.
InvalidParameter.UserName.Length
  • HTTP Status:400
  • Error Message:The parameter - "UserName" beyond the length limit.
EntityNotExist.User
  • HTTP Status:404
  • Error Message:The user does not exist.

操作示例

请求示例

https://ram.aliyuncs.com/?Action=ListPoliciesForUser
&<公共请求参数>

返回示例

  • XML格式
    <ListPoliciesForUserResponse>
        <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
        <Policies>
            <Policy>
                <PolicyName>OSS-Administrator</PolicyPolicyName>
                <PolicyType>Custom</PolicyType>
                <Description>OSS管理员权限</Description>
                <DefaultVersion>v1</DefaultVersion>
                <AttachDate>2015-01-23T12:33:18Z</AttachDate>
            </Policy>
            <Policy>
                <PolicyName>ReadOnlyAccess</PolicyPolicyName>
                <PolicyType>System</PolicyType>
                <Description>只读权限</Description>
                <DefaultVersion>v1</DefaultVersion>
                <AttachDate>2015-02-18T17:22:08Z</AttachDate>
            </Policy>
        </Policies>
    </ListPoliciesForUserResponse>
  • JSON格式
    {
        "RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
        "Policies": {
            "Policy": [
                {
                    "PolicyName": "OSS-Administrator",
                    "PolicyType": "Custom",
                    "Description": "OSS管理员权限",
                    "DefaultVersion": "v1",
                    "AttachDate": "2015-01-23T12:33:18Z"
                },
                {
                    "PolicyName": "ReadOnlyAccess",
                    "PolicyType": "System",
                    "Description": "只读权限",
                    "DefaultVersion": "v1",
                    "AttachDate": "2015-02-18T17:22:08Z"
                }
            ]
        }
    }