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

   This is a fix for #23926.
   
   The issue is that the following code
   ```
   if self.appbuilder.app.config.get("FAB_ADD_SECURITY_PERMISSION_VIEW", True):
               self.appbuilder.add_view(
                   self.actionmodelview,
                   "Actions",
                   icon="fa-lock",
                   label=_("Actions"),
                   category="Security",
               )
   ```
   
https://github.com/apache/airflow/blob/main/airflow/www/fab_security/manager.py#L769-L775
   
   causes the following actions
   
   ```
   {manager.py:545} INFO - Removed Permission View: menu_access on Permissions
   {manager.py:509} INFO - Created Permission View: menu access on Permissions
   ```
   
   The lines 
   ```
           if 
self.appbuilder.app.config.get("FAB_ADD_SECURITY_PERMISSION_VIEWS_VIEW", True):
               self.appbuilder.add_view(
                   self.permissionmodelview,
                   "Permissions",
                   icon="fa-link",
                   label=_("Permissions"),
                   category="Security",
               )
   ```
   
https://github.com/apache/airflow/blob/main/airflow/www/fab_security/manager.py#L785-L792
 
   
   cause
   
   ```
   {manager.py:509} INFO - Created Permission View: menu access on Permissions
   {manager.py:571} INFO - Added Permission menu access on Permissions to role 
Admin
   ```
   
   This is because in code block 1, `ActionModelView.class_permission_name = 
"Permissions"`, and the view name used in code block 2 is `"Permissions",`. 
This causes a conflict where permissions get removed from and then added to 
`Permissions` every time the app worker loads.
   
   As a solution, I've renamed the view name in the second code block to 
`Permission Pairs`, which removes the conflict between the two code blocks.


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