Skip to content

Instantly share code, notes, and snippets.

@tsatsujnr139
Created April 21, 2021 23:09
Show Gist options
  • Save tsatsujnr139/8dab4e7ddc13579163374dc9cb5b4d5e to your computer and use it in GitHub Desktop.
Save tsatsujnr139/8dab4e7ddc13579163374dc9cb5b4d5e to your computer and use it in GitHub Desktop.
@router.get("", response_model=List[schemas.User])
def read_users(
db: Session = Depends(deps.get_db),
skip: int = 0,
limit: int = 100,
current_user: models.User = Security(
deps.get_current_active_user,
scopes=[Role.ADMIN["name"], Role.SUPER_ADMIN["name"]],
),
) -> Any:
"""
Retrieve all users.
"""
users = crud.user.get_multi(db, skip=skip, limit=limit,)
return users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment