fat-catTW commented on code in PR #72715:
URL: https://github.com/apache/airflow/pull/72715#discussion_r4371779537
##########
airflow-core/src/airflow/api_fastapi/core_api/security.py:
##########
@@ -228,6 +228,30 @@ def inner(
return inner
+def requires_access_dag_bundle(method: ResourceMethod) -> Callable[[str,
BaseUser, Session], None]:
+ """Authorize a Dag bundle action against its owning team."""
+
+ def inner(bundle_name: str, user: GetUserDep, session: SessionDep) -> None:
+ bundle = session.scalar(
+ select(DagBundleModel).where(
+ DagBundleModel.name == bundle_name,
+ DagBundleModel.active.is_(True),
+ )
+ )
+ if bundle is None:
+ raise HTTPException(status.HTTP_404_NOT_FOUND, "Dag bundle not
found")
Review Comment:
Updated!
--
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]