From c23230d5091a47fbbea2a849c8f85ab4bcbfefeb Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Wed, 6 Apr 2005 15:16:12 +0000
Subject: [PATCH] Define recursiveReindexObject as an alias to reindexObject.
 Override reindexObjectSecurity to reindex sub-objects with
 recursiveReindexObject.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2831 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 51216c70fd..1b5a3d28c2 100755
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -192,7 +192,7 @@ def initializePortalTypeDynamicProperties(self, klass, ptype, recursive=0):
       # We should now make sure workflow methods are defined
       # and also make sure simulation state is defined
       portal_workflow = getToolByName(self, 'portal_workflow')
-      #LOG('getWorkflowsFor', 0, str(portal_workflow.getWorkflowsFor(self)))
+      #LOG('getWorkflowsFor', 0, str((self, [wf.id for wf in portal_workflow.getWorkflowsFor(self)])))
       for wf in portal_workflow.getWorkflowsFor(self):
         wf_id = wf.id
         try:
@@ -1651,7 +1651,20 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
     root_indexable = int(getattr(self.getPortalObject(),'isIndexable',1))
     if self.isIndexable and root_indexable:
       self.activate(**kw).immediateReindexObject(*args, **kw)
+      
+  security.declarePublic('recursiveReindexObject')
+  recursiveReindexObject = reindexObject
 
+  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, 'called')
+    self.recursiveReindexObject()
+            
   def immediateQueueCataloggedObject(self, *args, **kw):
     if self.isIndexable:
       catalog_tool = getToolByName(self, 'portal_catalog', None)
-- 
2.30.9