Skip to content

Commit

Permalink
feat: 获取分组下的角色列表支持传分组id的列表 (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
zgqgit committed Jun 18, 2024
2 parents 858411a + dc17a2c commit d15b237
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/backend/bisheng/api/v1/usergroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async def get_group_resources(*,

@router.get("/roles", response_model=UnifiedResponseModel)
async def get_group_roles(*,
group_id: int = Query(..., description="用户组ID"),
group_id: List[int] = Query(..., description="用户组ID列表"),
keyword: str = Query(None, description="搜索关键字"),
page: int = 0,
limit: int = 0,
Expand All @@ -184,11 +184,11 @@ async def get_group_roles(*,
获取用户组内的角色列表
"""
# 判断是否是用户组的管理员
if not user.check_group_admin(group_id):
if not user.check_groups_admin(group_id):
return UnAuthorizedError.return_resp()
# 查询组下角色列表
role_list = RoleDao.get_role_by_groups([group_id], keyword, page, limit)
total = RoleDao.count_role_by_groups([group_id], keyword)
role_list = RoleDao.get_role_by_groups(group_id, keyword, page, limit)
total = RoleDao.count_role_by_groups(group_id, keyword)

return resp_200(data={
"data": role_list,
Expand Down

0 comments on commit d15b237

Please sign in to comment.