Commit 9d3a3fc6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! ERP5Workflow: DC Workflows are now ERP5 objects (!1378).

If state_permission_role_list_dict is not yet set in a Workflow State, the UI displays permission/role table with all unchecked.
Once we save it in Permissions tab without checking anything, state_permission_role_list_dict will become like
  {'Access contents information': (),
   'Add portal content': (),
   'Modify portal content': (),
   'View': ()}
This commit will make the behaviour same for these 'before save' and 'after save' cases as the UI displays exactly same.
parent fe7a66eb
...@@ -113,9 +113,9 @@ class WorkflowState(IdAsReferenceMixin("state_"), ...@@ -113,9 +113,9 @@ class WorkflowState(IdAsReferenceMixin("state_"),
""" """
return the permission/roles dict return the permission/roles dict
""" """
if self.state_permission_role_list_dict is None: state_permission_role_list_dict_get = (self.state_permission_role_list_dict or {}).get
return {} return {k: state_permission_role_list_dict_get(k, ())
return dict(self.state_permission_role_list_dict.items()) for k in self.getWorkflowManagedPermissionList()}
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'setPermission') 'setPermission')
......
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