This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 959e52bf3c Simplify action name retrieval in FAB auth manager (#39358)
959e52bf3c is described below
commit 959e52bf3c48ba1f2622187179fca28f908a859a
Author: Jed Cunningham <[email protected]>
AuthorDate: Thu May 2 10:54:25 2024 -0400
Simplify action name retrieval in FAB auth manager (#39358)
---
airflow/providers/fab/auth_manager/fab_auth_manager.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/airflow/providers/fab/auth_manager/fab_auth_manager.py
b/airflow/providers/fab/auth_manager/fab_auth_manager.py
index 547bc626bb..ffd5e5cab5 100644
--- a/airflow/providers/fab/auth_manager/fab_auth_manager.py
+++ b/airflow/providers/fab/auth_manager/fab_auth_manager.py
@@ -272,10 +272,7 @@ class FabAuthManager(BaseAuthManager):
):
if not user:
user = self.get_user()
- if method in get_fab_action_from_method_map():
- fab_action_name = get_fab_action_from_method_map()[method]
- else:
- fab_action_name = method
+ fab_action_name = get_fab_action_from_method_map().get(method, method)
return (fab_action_name, resource_name) in
self._get_user_permissions(user)
@provide_session