Commit 75bc2245 authored by wenjie.zheng's avatar wenjie.zheng

Interaction.py: fix interaction guard creat and update function.

parent a6f4e603
......@@ -103,20 +103,19 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject):
return self.guard
def generateGuard(self):
if self.trigger_type == TRIGGER_USER_ACTION:
if self.guard == None:
self.guard = Guard(permissions=self.getPermissionList(),
roles=self.getRoleList(),
groups=self.getGroupList(),
expr=self.getExpression())
if self.guard.roles != self.getRoleList():
self.guard.roles = self.getRoleList()
elif self.guard.permissions != self.getPermissionList():
self.guard.permissions = self.getPermissionList()
elif self.guard.groups != self.getGroupList():
self.guard.groups = self.getGroupList()
elif self.guard.expr != self.getExpression():
self.guard.expr = self.getExpression()
if self.guard == None:
self.guard = Guard(permissions=self.getPermissionList(),
roles=self.getRoleList(),
groups=self.getGroupList(),
expr=self.getExpression())
if self.guard.roles != self.getRoleList():
self.guard.roles = self.getRoleList()
elif self.guard.permissions != self.getPermissionList():
self.guard.permissions = self.getPermissionList()
elif self.guard.groups != self.getGroupList():
self.guard.groups = self.getGroupList()
elif self.guard.expr != self.getExpression():
self.guard.expr = self.getExpression()
def getMethodId(self):
if type(self.method_id) is type(''):
......
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