exploy commented on a change in pull request #4118: [AIRFLOW-3271] Airflow RBAC 
Permissions modification via UI do not persist
URL: https://github.com/apache/incubator-airflow/pull/4118#discussion_r230946740
 
 

 ##########
 File path: airflow/www_rbac/security.py
 ##########
 @@ -181,13 +181,17 @@ def init_role(self, role_name, role_vms, role_perms):
         if not role:
             role = self.add_role(role_name)
 
-        role_pvms = []
-        for pvm in pvms:
-            if pvm.view_menu.name in role_vms and pvm.permission.name in 
role_perms:
-                role_pvms.append(pvm)
-        role.permissions = list(set(role_pvms))
-        self.get_session.merge(role)
-        self.get_session.commit()
+        if (len(role.permissions) == 0):
 
 Review comment:
   python does not require you to surround if condition with brackets.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to