rawwar commented on code in PR #47194:
URL: https://github.com/apache/airflow/pull/47194#discussion_r1975374362


##########
airflow/api_fastapi/core_api/security.py:
##########
@@ -82,6 +82,23 @@ def callback():
     return inner
 
 
+def requires_access_connection(method: ResourceMethod) -> Callable:
+    def inner(
+        connection_id: str | None = None,
+        user: Annotated[BaseUser | None, Depends(get_user)] = None,
+    ) -> None:
+        def callback():
+            return get_auth_manager().is_authorized_dag(
+                method=method, 
details=ConnectionDetails(conn_id=connection_id), user=user
+            )
+
+        _requires_access(
+            is_authorized_callback=callback,

Review Comment:
   personally, I find this cleaner. We can definitely use lambda.
   
   On an another note, I should be using `is_authorized_connection` here. my 
bad 



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