arjav1528 opened a new pull request, #61083:
URL: https://github.com/apache/airflow/pull/61083

   Closes #60972
   
   ## Summary
   
   Fixes issue where Admin users were denied access to user management views 
when permissions weren't properly synced or when switching between 
authentication types.
   
   ## Problem
   
   When Airflow is configured with one authentication type (e.g., `AUTH_DB`), 
only the corresponding user model view is registered. During permission sync, 
permissions were only created for the active auth type's view. This caused:
   
   - Admin role missing permissions for inactive user model views
   - "Access Denied" errors when switching authentication types
   - Admin unable to access user management UI
   
   ## Solution
   
   Added `ensure_user_model_view_permissions()` method that explicitly 
registers permissions for all user model views (CustomUserDBModelView, 
CustomUserLDAPModelView, CustomUserOAuthModelView, 
CustomUserRemoteUserModelView) during `sync_roles()`, regardless of which 
authentication type is currently active.
   
   The method is called before `update_admin_permission()` to ensure all 
permissions exist in the database before they're assigned to the Admin role.
   
   
   


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