zachliu commented on code in PR #41549:
URL: https://github.com/apache/airflow/pull/41549#discussion_r1727823208
##########
airflow/models/dag.py:
##########
@@ -936,16 +938,26 @@ def update_old_perm(permission: str):
updated_access_control = {}
for role, perms in access_control.items():
- updated_access_control[role] = updated_access_control.get(role, {})
- if isinstance(perms, (set, list)):
- # Support for old-style access_control where only the actions
are specified
- updated_access_control[role][permissions.RESOURCE_DAG] =
set(perms)
+ if packaging_version.parse(FAB_VERSION) >=
packaging_version.parse("1.3.0"):
+ updated_access_control[role] =
updated_access_control.get(role, {})
+ if isinstance(perms, (set, list)):
+ # Support for old-style access_control where only the
actions are specified
+ updated_access_control[role][permissions.RESOURCE_DAG] =
set(perms)
+ else:
+ updated_access_control[role] = perms
Review Comment:
@joaopamaral
```suggestion
if isinstance(perms, (set, list)):
# Support for old-style access_control where only the
actions are specified
updated_access_control[role] = perms
else:
updated_access_control[role][permissions.RESOURCE_DAG] =
set(perms)
```
believe it's the root cause of https://github.com/apache/airflow/issues/41684
--
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]