From cdfeb911fb63afc072614374ccbdcb671602dc66 Mon Sep 17 00:00:00 2001 From: Lukas Barragan Torres Date: Thu, 7 Mar 2024 16:50:14 +0100 Subject: [PATCH] authenticatie nodig bij bekijken project #45 --- backend/routes/project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/routes/project.py b/backend/routes/project.py index c3392ea1..fa90c918 100644 --- a/backend/routes/project.py +++ b/backend/routes/project.py @@ -4,10 +4,13 @@ from db.sessions import get_session from domain.logic.project import get_project from domain.models.ProjectDataclass import ProjectDataclass +from routes.dependencies.role_dependencies import is_user_authorized_for_subject project_router = APIRouter() @project_router.get("/projects/{project_id}") def get_subject_project(project_id: int, session: Session = Depends(get_session)) -> ProjectDataclass: - return get_project(session, project_id) + project: ProjectDataclass = get_project(session, project_id) + is_user_authorized_for_subject(session, project.subject_id) + return project