ashb commented on a change in pull request #11189:
URL: https://github.com/apache/airflow/pull/11189#discussion_r499800190



##########
File path: airflow/www/security.py
##########
@@ -520,18 +560,23 @@ def merge_pv(perm, view_menu):
     def update_admin_perm_view(self):
         """
         Admin should has all the permission-views, except the dag views.
-        because Admin have already have all_dags permission.
+        because Admin have already have Dag permission.
         Add the missing ones to the table for admin.
 
         :return: None.
         """
-        all_dag_view = self.find_view_menu('all_dags')
-        dag_perm_ids = [self.find_permission('can_dag_edit').id, 
self.find_permission('can_dag_read').id]
+        all_dag_view = self.find_view_menu('Dag')
+        pvs = (
+            self.get_session.query(sqla_models.ViewMenu)
+            .filter(sqla_models.ViewMenu.name.like(f"{DAG_PREFIX}%"))
+            .all()
+        )
+        pv_ids = [pv.id for pv in pvs]

Review comment:
       (not saying this is a good idea, or even clear to read) but:
   
   ```python shell
   >>> (x,) = zip(*((1,),(2,)))                                                 
                                                                                
                                                                                
                                                                                
                                           
   >>> x                                                                        
                                                                                
                                                                                
                                                                                
                                           
   (1, 2)
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to