Commit fc299dd5 authored by Sebastien Robin's avatar Sebastien Robin

corrected problems with dates and also permissions


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1142 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ef3facf
...@@ -243,7 +243,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -243,7 +243,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
object.manage_delLocalGroupRoles([user]) object.manage_delLocalGroupRoles([user])
if xml.nodeName in self.local_permission_list and not simulate: if xml.nodeName in self.local_permission_list and not simulate:
permission = self.getAttribute(xml,'id') permission = self.getAttribute(xml,'id')
setPermissionMapping(permission,object) object.manage_setLocalPermissions(permission)
return conflict_list return conflict_list
security.declareProtected(Permissions.ModifyPortalContent, 'updateNode') security.declareProtected(Permissions.ModifyPortalContent, 'updateNode')
...@@ -1047,7 +1047,7 @@ class ERP5Conduit(XMLSyncUtilsMixin): ...@@ -1047,7 +1047,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
#user = roles[0] #user = roles[0]
#roles = roles[1:] #roles = roles[1:]
if xml.nodeName.find(self.local_permission_tag)>=0: if xml.nodeName.find(self.local_permission_tag)>=0:
setPermissionMapping(permission,object,roles) object.manage_setLocalPermissions(permission,roles)
return conflict_list return conflict_list
security.declareProtected(Permissions.ModifyPortalContent, 'editDocument') security.declareProtected(Permissions.ModifyPortalContent, 'editDocument')
......
...@@ -577,13 +577,14 @@ class XMLSyncUtilsMixin(SyncCode): ...@@ -577,13 +577,14 @@ class XMLSyncUtilsMixin(SyncCode):
if signature is not None: if signature is not None:
LOG('getSyncMLData',0,'signature.status: %s' % str(signature.getStatus())) LOG('getSyncMLData',0,'signature.status: %s' % str(signature.getStatus()))
LOG('getSyncMLData',0,'signature.action: %s' % str(signature.getAction())) LOG('getSyncMLData',0,'signature.action: %s' % str(signature.getAction()))
last_modification = object.ModificationDate() last_modification = DateTime(object.ModificationDate())
last_synchronization = signature.getLastSynchronizationDate() last_synchronization = signature.getLastSynchronizationDate()
parent = object.aq_parent parent = object.aq_parent
# XXX CPS Specific # XXX CPS Specific
if parent.id == 'portal_repository': if parent.id == 'portal_repository':
if last_synchronization is not None and last_modification is not None: if last_synchronization is not None and last_modification is not None:
if last_synchronization > last_modification: if last_synchronization > last_modification:
LOG('getSyncMLData, no modification on: ',0,object.id)
signature.setStatus(self.SYNCHRONIZED) signature.setStatus(self.SYNCHRONIZED)
status = self.SENT status = self.SENT
more_data=0 more_data=0
......
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