Commit 1a4fd71e authored by Sebastien Robin's avatar Sebastien Robin

manage now security settings


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@169 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2b6bd9cd
This diff is collapsed.
......@@ -70,8 +70,8 @@ class SyncCode(Persistent):
#ENCODING='iso-8859-1'
NOT_EDITABLE_PROPERTY = ('id','object','security_info','uid','workflow_history',
'xupdate:element','xupdate:attribute')
NOT_EDITABLE_PROPERTY = ('id','object','uid','xupdate:element','workflow_history',
'xupdate:attribute','local_role')
XUPDATE_INSERT = ('xupdate:insert-after','xupdate:insert-before')
XUPDATE_ADD = ('xupdate:append',)
XUPDATE_DEL = ('xupdate:remove',)
......@@ -88,6 +88,11 @@ class SyncCode(Persistent):
pickle_type_list = ('pickle',)
xml_object_tag = 'object'
history_tag = 'workflow_history'
local_role_tag = 'local_role'
local_role_list = (local_role_tag,'/'+local_role_tag)
action_tag = 'workflow_action'
ADDABLE_PROPERTY = (local_role_tag,history_tag)
sub_object_exp = "/object\[@id='.*'\]/object\[@id='.*'\]"
object_exp = "/object\[@id='.*'\]"
sub_sub_object_exp = "/object\[@id='.*'\]/object\[@id='.*'\]/object\[@id='.*'\]"
history_exp = "/object\[@id='.*'\]/%s\[@id='.*'\]" % history_tag
......@@ -267,6 +267,13 @@ class SynchronizationTool( UniqueObject, SimpleItem,
conflict_list += [conflict]
return conflict_list
def getSynchronizationState(self, context):
"""
context -- the context on which we are looking for state
"""
def manageLocalValue(self, domain, domain_id, object_path, RESPONSE=None):
"""
Do whatever needed in order to store the local value on
......
......@@ -523,7 +523,7 @@ class XMLSyncUtilsMixin(SyncCode):
Return childNodes that are ElementNode
"""
subnode_list = []
for subnode in node.childNodes:
for subnode in node.childNodes or []:
if subnode.nodeType == subnode.ELEMENT_NODE:
subnode_list += [subnode]
return subnode_list
......@@ -533,7 +533,7 @@ class XMLSyncUtilsMixin(SyncCode):
Return childNodes that are ElementNode
"""
subnode_list = []
for subnode in node.childNodes:
for subnode in node.childNodes or []:
if subnode.nodeType == subnode.TEXT_NODE:
subnode_list += [subnode]
return subnode_list
......@@ -543,7 +543,7 @@ class XMLSyncUtilsMixin(SyncCode):
Return childNodes that are ElementNode
"""
attribute_list = []
for subnode in node.attributes:
for subnode in node.attributes or []:
if subnode.nodeType == subnode.ATTRIBUTE_NODE:
attribute_list += [subnode]
return attribute_list
......
......@@ -47,19 +47,17 @@ class XupdateUtils(XMLSyncUtilsMixin):
for subnode in self.getElementNodeList(xupdate):
selection_name = ''
if subnode.nodeName in self.XUPDATE_ADD:
# Check if we do not have a fake tag somewhere
for subnode1 in self.getElementNodeList(subnode):
if subnode1.nodeName == 'xupdate:element':
conflict_list += conduit.addNode(xml=subnode, object=object, force=force, **kw)
elif subnode1.nodeName == 'xupdate:text':
conflict_list += conduit.addNode(xml=subnode,object=object, force=force, **kw)
if subnode.nodeName in self.XUPDATE_INSERT_OR_ADD:
conflict_list += conduit.addNode(xml=subnode,object=object, \
force=force, **kw)
elif subnode.nodeName in self.XUPDATE_DEL:
conflict_list += conduit.deleteNode(xml=subnode, object=object, force=force, **kw)
conflict_list += conduit.deleteNode(xml=subnode, object=object, \
force=force, **kw)
elif subnode.nodeName in self.XUPDATE_UPDATE:
conflict_list += conduit.updateNode(xml=subnode, object=object, force=force, **kw)
elif subnode.nodeName in self.XUPDATE_INSERT:
conflict_list += conduit.addNode(xml=subnode, object=object, force=force, **kw)
conflict_list += conduit.updateNode(xml=subnode, object=object, \
force=force, **kw)
#elif subnode.nodeName in self.XUPDATE_INSERT:
# conflict_list += conduit.addNode(xml=subnode, object=object, force=force, **kw)
return conflict_list
......
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