Esempio n. 1
0
 def initializeInstance(self, instance, item=None, container=None):
     """
     """
     path = '/'.join(instance.getPhysicalPath())
     rename_or_copy = False
     if self.isInitialized(instance) and \
        self.getInstancePath(instance) != path:
         rename_or_copy = True
         instance._v_renaming = True
         if not self.hasTempData(instance):
             instance._v_copying = True
     if rename_or_copy:
         try:
             sm = getSecurityManager()
             manager.id = sm.getUser().getId()
             newSecurityManager(instance.REQUEST, manager)
             ExternalStorage.initializeInstance(self, instance, item, container)
             setSecurityManager(sm)
         except Unauthorized:
             pass
     else:
         ExternalStorage.initializeInstance(self, instance, item, container)
     instance._v_renaming, instance._v_copying = False, False