kaxil commented on code in PR #72909:
URL: https://github.com/apache/airflow/pull/72909#discussion_r4020249923
##########
airflow-core/src/airflow/api_fastapi/common/types.py:
##########
@@ -120,6 +120,7 @@ class MenuItem(Enum):
CONFIG = "Config"
CONNECTIONS = "Connections"
DAGS = "Dags"
+ DAG_BUNDLES = "Dag Bundles"
Review Comment:
Good catch, this was a real gap. Added in 8e53572.
`MenuItem.DAG_BUNDLES` now goes into `TEAM_MENU_ITEMS` rather than
`TEAM_ADMIN_MENU_ITEMS`, since bundle visibility rides on Dag read: a team
Viewer who can already reach the bundles through the API should be able to find
the page. `TEAM_ADMIN_MENU_ITEMS` is derived from the base set, so both roles
pick it up. Guarded with `hasattr(MenuItem, "DAG_BUNDLES")` so the provider
still imports against Airflow versions predating the item, matching how the FAB
mapping is guarded.
The generated grants are covered: `test_create_team_command` now asserts
`["Assets", "Dag Bundles", "Dags", "Docs"]` on the `MenuAccess-team-a`
permission and the eight-item list on `MenuAccess-Admin-team-a`, on both the
`_ensure_scope_permission` and `_attach_policy_to_scope_permission` calls. The
SuperAdmin grant already built its list from `sorted(MenuItem, ...)`, so it
picked the item up without a change.
--
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]