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