Commit 5d6b7fd5 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Workflow: fix adding permissions

Follow up of ff624fd2 (ERP5Workflow: newly added permission should be
acquired for all existing states., 2024-11-04) and cbef6282 (ERP5Workflow:
make sure not create duplicate permissions, 2024-11-05)
parent cbef6282
Pipeline #37865 failed with stage
in 0 seconds
......@@ -1440,16 +1440,13 @@ class Workflow(XMLObject):
return res
def _setWorkflowManagedPermissionList(self, permission_list):
current_permission_list = self.getWorkflowManagedPermissionList()
self._baseSetWorkflowManagedPermission(permission_list)
# Add/remove the added/removed Workflow permissions to each state
for state in self.getStateValueList():
current_acquire_permission_set = set(state.getAcquirePermissionList())
state.setAcquirePermissionList(
list(
{e for e in state.getAcquirePermissionList() if e in permission_list}
| (set(permission_list) - set(current_permission_list))))
[e for e in permission_list if e in current_acquire_permission_set])
permission_role_list_dict = state.getStatePermissionRoleListDict()
state.setStatePermissionRoleListDict({
permission: permission_role_list_dict.get(permission, [])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment