Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
authenticatie nodig bij bekijken project #45
Browse files Browse the repository at this point in the history
  • Loading branch information
lbarraga committed Mar 7, 2024
1 parent c9d1fea commit cdfeb91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/routes/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cdfeb91

Please sign in to comment.