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