From 74edd20ab64da9a1ca24f7d9e84fc27f2cd08ea6 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Thu, 7 Apr 2005 16:50:10 +0000
Subject: [PATCH] Define its own reindexObjectSecurity.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2847 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Document/Folder.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/Document/Folder.py b/product/ERP5Type/Document/Folder.py
index 4dc0abc71d..04ff8f477a 100755
--- a/product/ERP5Type/Document/Folder.py
+++ b/product/ERP5Type/Document/Folder.py
@@ -301,8 +301,6 @@ be a problem)."""
   _edit = Base._edit
   _setPropValue = Base._setPropValue
   _propertyMap = Base._propertyMap # are there any others XXX ?
-  security.declareProtected(Permissions.ModifyPortalContent, 'reindexObjectSecurity')
-  reindexObjectSecurity = Base.reindexObjectSecurity
   
   # CPS patch circumvent
   manage_renameObject = OriginalCopyContainer.manage_renameObject   
@@ -496,6 +494,20 @@ be a problem)."""
     """
     return Base.reindexObject(self, *args, **kw)
 
+  security.declareProtected(Permissions.ModifyPortalContent, 'reindexObjectSecurity')
+  def reindexObjectSecurity(self):
+    """
+        Reindex security-related indexes on the object
+        (and its descendants).
+    """
+    # In ERP5, simply reindex all objects.
+    #LOG('reindexObjectSecurity', 0, 'self = %r, self.getPath() = %r' % (self, self.getPath()))
+    self.reindexObject()
+    # Reindex contents
+    for c in self.objectValues():
+      if hasattr(aq_base(c), 'reindexObjectSecurity'):
+       c.reindexObjectSecurity()
+    
   security.declarePublic( 'recursiveReindexObject' )
   def recursiveReindexObject(self, *args, **kw):
     """
-- 
2.30.9