Skip to content

Commit

Permalink
Merge pull request #370 from uhh-lt/AnnoFix
Browse files Browse the repository at this point in the history
Anno fix
  • Loading branch information
bigabig authored Apr 16, 2024
2 parents 868679a + ddde3e7 commit 87dbfec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/api/endpoints/bbox_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def add_bbox_annotation(
resolve_code: bool = Depends(resolve_code_param),
authz_user: AuthzUser = Depends(),
) -> Union[BBoxAnnotationRead, BBoxAnnotationReadResolvedCode]:
authz_user.assert_object_has_same_user_id(
Crud.ANNOTATION_DOCUMENT, bbox.annotation_document_id
)
authz_user.assert_in_same_project_as(
Crud.ANNOTATION_DOCUMENT, bbox.annotation_document_id
)
Expand Down
3 changes: 3 additions & 0 deletions backend/src/api/endpoints/span_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def add_span_annotation(
authz_user: AuthzUser = Depends(),
validate: Validate = Depends(),
) -> Union[SpanAnnotationRead, SpanAnnotationReadResolved]:
authz_user.assert_object_has_same_user_id(
Crud.ANNOTATION_DOCUMENT, span.annotation_document_id
)
authz_user.assert_in_same_project_as(Crud.CODE, span.code_id)
authz_user.assert_in_same_project_as(
Crud.ANNOTATION_DOCUMENT, span.annotation_document_id
Expand Down

0 comments on commit 87dbfec

Please sign in to comment.