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:
   We did remove completely the `DagAccessEntity.TASK_INSTANCE`?
   
   Is that because we return task definition and no runtime (TaskInstance 
information)?
   
   Even when `external_dependencies` is False. 



-- 
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]

Reply via email to