Commit b5682726 authored by wenjie.zheng's avatar wenjie.zheng

Workflow.py: clean Permission Role list after Role mapping; Transition.py:...

Workflow.py: clean Permission Role list after Role mapping; Transition.py: Remapping roles after changing state.
parent 0deeabc4
......@@ -68,7 +68,8 @@ class Transition(XMLObject):
# Modify the state
self._changeState(document)
### zwj: update Role mapping, also in Workflow, initialiseDocument()
self.getParent().updateRoleMappingsFor(document)
# Get variable values
status_dict = workflow.getCurrentStatusDict(document)
status_dict['undo'] = 0
......
......@@ -185,27 +185,17 @@ class Workflow(XMLObject):
self.erp5_permission_roles[permission] += (role,)
else:
self.erp5_permission_roles.update({permission : (role,)})
### zwj: update role list to permission
for permission_roles in self.erp5_permission_roles.keys():
if modifyRolesForPermission(document, permission_roles, self.erp5_permission_roles[permission_roles]):
changed = 1
### zwj: clean Permission Role list for next role mapping
del self.erp5_permission_roles[permission_roles]
return changed
def getRoleList(self):
return self.role_list
### zwj: unknown objective function
"""
def _checkTransitionGuard(self, t, document, **kw):
guard = t.guard
if guard is None:
return 1
if guard.check(getSecurityManager(), self, document, **kw):
return 1
return
"""
### Security feature end
###########
......
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