Skip to content

group_names

Definition /auth/group-names/ endpoints

get_list_user_group_names(user=Depends(current_active_user), db=Depends(get_async_db)) async

Return the available group names.

This endpoint is not restricted to superusers.

Source code in fractal_server/app/routes/auth/group_names.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@router_group_names.get(
    "/group-names/", response_model=list[str], status_code=status.HTTP_200_OK
)
async def get_list_user_group_names(
    user: UserOAuth = Depends(current_active_user),
    db: AsyncSession = Depends(get_async_db),
) -> list[str]:
    """
    Return the available group names.

    This endpoint is not restricted to superusers.
    """
    stm_all_groups = select(UserGroup)
    res = await db.execute(stm_all_groups)
    groups = res.scalars().all()
    group_names = [group.name for group in groups]
    return group_names