pierrejeambrun commented on code in PR #67823:
URL: https://github.com/apache/airflow/pull/67823#discussion_r3396043826
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/structure.py:
##########
@@ -40,14 +40,22 @@
structure_router = AirflowRouter(tags=["Structure"], prefix="/structure")
+def check_structure_data_access(
+ request: Request,
+ user: GetUserDep,
+ external_dependencies: bool = False,
+) -> None:
+ """Check permissions for the structure endpoint."""
+ requires_access_dag("GET")(request, user)
+
+ if external_dependencies:
+ requires_access_dag("GET", DagAccessEntity.DEPENDENCIES)(request, user)
+
+
@structure_router.get(
"/structure_data",
responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
- dependencies=[
- Depends(requires_access_dag("GET")),
- Depends(requires_access_dag("GET", DagAccessEntity.DEPENDENCIES)),
- Depends(requires_access_dag("GET", DagAccessEntity.TASK_INSTANCE)),
Review Comment:
Why did you completely remove the `DagAccessEntity.TASK_INSTANCE`?
I believe we return 'TI' related information such as "id", "label",
"is_mapped", "children", etc....
Even when `external_dependencies` is False.
I think we should keep it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]