Skip to content

Commit 9c4defa

Browse files
committed
Fix permission check on DAGs when access_entity is specified
1 parent 8317ed9 commit 9c4defa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

airflow/api_connexion/security.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ def callback():
145145
# ``access`` means here:
146146
# - if a DAG id is provided (``dag_id`` not None): is the user authorized to access this DAG
147147
# - if no DAG id is provided: is the user authorized to access all DAGs
148-
if dag_id or access:
148+
if dag_id or access or access_entity:
149149
return access
150150

151-
# No DAG id is provided and the user is not authorized to access all DAGs
151+
# No DAG id is provided, the user is not authorized to access all DAGs and authorization is done
152+
# on DAG level
152153
# If method is "GET", return whether the user has read access to any DAGs
153154
# If method is "PUT", return whether the user has edit access to any DAGs
154155
return (method == "GET" and any(get_auth_manager().get_permitted_dag_ids(methods=["GET"]))) or (

0 commit comments

Comments
 (0)