接口描述

列出角色被授予的授权策略

请求参数

Action
  • 类型:String
  • 必须:是
  • 描述:系统规定参数,取值:ListPoliciesForRole
RoleName
  • 类型:String
  • 必须:是
  • 描述:指定角色名。例:AdminRole

返回参数

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

错误信息

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

操作示例

请求示例

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

返回示例

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