GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
  • Single Page Web Application

  • Mobile and Client Applications

  • Standard Web Application

    • Java

    • Node.js

    • Python

      • 安装使用
      • 用户认证模块
      • 管理模块

        • 用户管理

        • 分组管理

        • 角色管理

          • 获取角色详情
          • 分配角色
          • 移除分配的角色
          • 获取角色被授权的资源列表
          • 获取角色成员列表
          • 获取角色的部门列表
          • 创建角色
          • 获取角色列表
          • 删除角色
          • 批量创建角色
          • 修改角色
        • 组织机构管理

        • 访问控制管理

        • 外部身份源管理

        • 自定义字段管理

  • Framework Integration

  • Others

  1. Development Integration
  2. /
  3. Standard Web Application
  4. /
  5. Python
  6. /
  7. 管理模块

  8. /
  9. 角色管理

  10. /
  11. 获取角色列表

¶ 获取角色列表

Update time: 2025-07-23 07:34:21
Edit

获取角色列表,支持分页。

¶ 请求参数

名称类型必填默认值描述示例值
namespacestring否default所属权限分组的 code。default
pagenumber否1当前页数,从 1 开始。1
limitnumber否10每页数目,最大不能超过 50,默认为 10。10

¶ 示例代码

from authing import ManagementClient

management_client = ManagementClient(
    access_key_id="GEN_AUTH_USERPOOL_ID",
    access_key_secret="GEN_AUTH_USERPOOL_SECRET",
)

data = management_client.list_roles(

      namespace: "default",

      page: 1,

      limit: 10,

)

¶ 请求响应

类型: RolePaginatedRespDto

名称类型描述
statusCodenumber业务状态码,可以通过此状态码判断操作是否成功,200 表示成功。
messagestring描述信息
apiCodenumber细分错误码,可通过此错误码得到具体的错误类型。
dataRolePagingDto响应数据

示例结果:

{
  "statusCode": 200,
  "message": "操作成功",
  "apiCode": 20001,
  "data": {
    "list": {
      "code": "role1",
      "description": "this is description",
      "namespace": "default"
    }
  }
}

¶ 数据结构

¶ RolePagingDto

名称类型必填描述
totalCountnumber是记录总数。
listarray是响应数据。嵌套类型:RoleDto。

¶ RoleDto

名称类型必填描述
codestring是权限分组内角色的唯一标识符。 示例值: role1
descriptionstring是角色描述。 示例值: this is description
namespacestring是所属权限分组的 code。 示例值: default
Previous article: 创建角色 Next article: 删除角色
  • 请求参数
  • 示例代码
  • 请求响应
  • 数据结构

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.