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

Transition.py: fix guard generator.

parent 25dee392
......@@ -93,16 +93,17 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject):
def generateGuard(self):
if self.trigger_type == TRIGGER_USER_ACTION:
if self.guard == None:
if self.guard is None:
self.guard = Guard(permissions=self.getPermissionList(),
roles=self.getRoleList(),
groups=self.getGroupList(),
expr=self.getExpression())
if self.guard.roles != self.getRoleList():
expr=Expression(self.getExpression()))
if self.getRoleList() is not None:
self.guard.roles = self.getRoleList()
if self.guard.permissions != self.getPermissionList():
if self.getPermissionList() is not None:
self.guard.permissions = self.getPermissionList()
if self.guard.groups != self.getGroupList():
if self.getGroupList() is not None:
self.guard.groups = self.getGroupList()
if self.guard.expr != self.getExpression():
self.guard.expr = self.getExpression()
if self.getExpression() is not None:
self.guard.expr = Expression(self.getExpression())
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