You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "arjav1528 (via GitHub)" <gi...@apache.org> on 2026/01/26 18:03:55 UTC
[PR] fix: Fix Admin access denied for user model views [airflow]
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Fix Admin access denied for user model views [airflow]
Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on PR #61083:
URL: https://github.com/apache/airflow/pull/61083#issuecomment-3801041599
Do you what changed in 3.1.6 to have this access denied? I'd be curious to know what exactly broke and if this is the right fix
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Fix Admin access denied for user model views [airflow]
Posted by "arjav1528 (via GitHub)" <gi...@apache.org>.
arjav1528 commented on PR #61083:
URL: https://github.com/apache/airflow/pull/61083#issuecomment-3800961881
@vincbeck I dont see a reason for failing the test, not sure what is the issue @copilot
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Fix Admin access denied for user model views [airflow]
Posted by "arjav1528 (via GitHub)" <gi...@apache.org>.
arjav1528 commented on PR #61083:
URL: https://github.com/apache/airflow/pull/61083#issuecomment-3801083705
update_admin_permission : this fn grants all the permission to the admin but only which exists in the db, but if the permission are never created, admin wont have them
so basically I wrote a new function ensure_user_model_view_permissions that explicitly defines the permission during the sync rolees before executing the update_admin_permission() executes
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Fix Admin access denied for user model views [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #61083: fix: Fix Admin access denied for user model views
URL: https://github.com/apache/airflow/pull/61083
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Fix Admin access denied for user model views [airflow]
Posted by "arjav1528 (via GitHub)" <gi...@apache.org>.
arjav1528 commented on PR #61083:
URL: https://github.com/apache/airflow/pull/61083#issuecomment-3801073835
> Do you what changed in 3.1.6 to have this access denied? I'd be curious to know what exactly broke and if this is the right fix
The root cause is a pre-existing architectural issue that became more visible, likely due to the removal of init_role or changes in FAB 5.x migration.
The issue: Permissions for RESOURCE_USER are only created when a user view is registered via register_views(). Since only the active auth type's view gets registered (see override.py:452-463), permissions may not exist in the database if
The auth type was changed after initial setup
Permissions weren't properly synced
A fresh database was used with a different auth type than before
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: Fix Admin access denied for user model views [airflow]
Posted by "arjav1528 (via GitHub)" <gi...@apache.org>.
arjav1528 commented on PR #61083:
URL: https://github.com/apache/airflow/pull/61083#issuecomment-3801085436
still there are some db tests failing, will check and resolve
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org