vincbeck commented on code in PR #62368:
URL: https://github.com/apache/airflow/pull/62368#discussion_r2842003186
##########
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:
Since this code is already used somewhere else in simple auth manager, could
you create a private method `_is_admin(user: SimpleAuthManagerUser)` which
returns whether the user is an admin and uses it please
--
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]