ephraimbuddy commented on code in PR #34355:
URL: https://github.com/apache/airflow/pull/34355#discussion_r1325690885
##########
airflow/api_connexion/endpoints/dag_warning_endpoint.py:
##########
@@ -57,7 +60,12 @@ def get_dag_warnings(
allowed_filter_attrs = ["dag_id", "warning_type", "message", "timestamp"]
query = select(DagWarningModel)
if dag_id:
+ if not get_airflow_app().appbuilder.sm.can_read_dag(dag_id, g.user):
Review Comment:
I feel we should have the DAG permission in the decorator instead of
handling this by ourselves. My vote would go to just adding
`(permissions.ACTION_CAN_READ, permissions.RESOURCE_DAG)` to the list of
permissions.
That should solve this. Assuming it's dag_ids instead of dag_id, then we can
do as you're doing now.
--
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]