pierrejeambrun commented on code in PR #62399:
URL: https://github.com/apache/airflow/pull/62399#discussion_r2907413731


##########
airflow-core/src/airflow/api_fastapi/core_api/security.py:
##########
@@ -179,6 +181,36 @@ def inner(
     return inner
 
 
+def requires_access_dag_run_bulk() -> Callable[[str, 
BulkBody[DAGRunPatchBody], BaseUser], None]:
+    def inner(
+        dag_id: str,
+        request: BulkBody[DAGRunPatchBody],
+        user: GetUserDep,
+    ) -> None:
+        normalized_dag_id: str | None = dag_id if dag_id != "~" else None
+        team_name = DagModel.get_team_name(normalized_dag_id) if 
normalized_dag_id else None
+
+        requests: list[IsAuthorizedDagRequest] = []
+        for action in request.actions:
+            methods = _get_resource_methods_from_bulk_request(action)
+            for method in methods:
+                req: IsAuthorizedDagRequest = {
+                    "method": method,
+                    "access_entity": DagAccessEntity.RUN,
+                    "details": DagDetails(id=normalized_dag_id, 
team_name=team_name),

Review Comment:
   dag_id should actually come from the payload so we can delete cross dags. 



##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py:
##########
@@ -179,3 +179,10 @@ class DAGRunsBatchBody(StrictBaseModel):
     duration_lt: float | None = None
 
     conf_contains: str | None = None
+
+
+class BulkDagRunBody(StrictBaseModel):

Review Comment:
   This is unused, but should be used I think.
   
   



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