From 5d07c6ad667e386251bd75cba8fd5d6f327e5286 Mon Sep 17 00:00:00 2001 From: Bram Reyniers Date: Mon, 20 May 2024 20:46:16 +0200 Subject: [PATCH] allow teachers to get all users --- backend/src/user/router.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/user/router.py b/backend/src/user/router.py index 279ac9e5..6688531f 100644 --- a/backend/src/user/router.py +++ b/backend/src/user/router.py @@ -12,6 +12,7 @@ retrieve_subjects, retrieve_user, admin_user_validation, + teacher_or_admin_user_validation, ) from .schemas import User, UserSimple, UserSubjectList from .service import set_admin, set_teacher, get_all_users @@ -25,7 +26,7 @@ ) -@router.get("/", dependencies=[Depends(admin_user_validation)]) +@router.get("/", dependencies=[Depends(teacher_or_admin_user_validation)]) async def get_users( db: AsyncSession = Depends(get_async_db), ) -> list[User]: