SamWheating commented on code in PR #33632:
URL: https://github.com/apache/airflow/pull/33632#discussion_r1303267764


##########
airflow/www/security.py:
##########
@@ -681,26 +681,12 @@ def sync_perm_for_dag(
         dag_resource_name = permissions.resource_name_for_dag(dag_id)
         for dag_action_name in self.DAG_ACTIONS:
             self.create_permission(dag_action_name, dag_resource_name)
-
-        def _revoke_all_stale_permissions(resource: Resource):
-            existing_dag_perms = self.get_resource_permissions(resource)
-            for perm in existing_dag_perms:
-                non_admin_roles = [role for role in perm.role if role.name != 
"Admin"]
-                for role in non_admin_roles:
-                    self.log.info(
-                        "Revoking '%s' on DAG '%s' for role '%s'",
-                        perm.action,
-                        dag_resource_name,
-                        role.name,
-                    )
-                    self.remove_permission_from_role(role, perm)
-
-        if access_control:
+        
+        if access_control is not None:

Review Comment:
   This is the most important change in this PR - `if access control` will 
proceed into the following block if and only if access_control is a non-empty 
dict, whereas `if access control is not None` will proceed given any dict, 
including an empty one.



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