yuseok89 commented on code in PR #62368:
URL: https://github.com/apache/airflow/pull/62368#discussion_r2843129016


##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/simple_auth_manager.py:
##########
@@ -265,7 +265,14 @@ def is_authorized_team(
         user: SimpleAuthManagerUser,
         details: TeamDetails | None = None,
     ) -> bool:
-        return details.name in user.teams if details else False
+        if not details:
+            return False
+        if user.role:
+            role_str = user.role.upper()
+            role = SimpleAuthManagerRole[role_str]
+            if role == SimpleAuthManagerRole.ADMIN:

Review Comment:
   Thanks for the review.
   I added a private `_is_admin(user: SimpleAuthManagerUser)` method and wired 
it into both `is_authorized_team` and `_is_authorized`.



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