From f44011bf05cac148f971c780012f3e062eef1c69 Mon Sep 17 00:00:00 2001
From: Nicolas Delaby <nicolas@nexedi.com>
Date: Tue, 27 Nov 2007 13:50:55 +0000
Subject: [PATCH] Call reindex after security update

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17822 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 4f93cd40cf..4f4d0783ff 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -3100,13 +3100,15 @@ class Base( CopyContainer,
 
   security.declareProtected(Permissions.ManagePortal,
                             'updateRoleMappingsFor')
-  def updateRoleMappingsFor(self, wf_id,**kw):
+  def updateRoleMappingsFor(self, wf_id, **kw):
     """
     Update security policy according to workflow settings given by wf_id
     """
     workflow = self.portal_workflow.getWorkflowById(wf_id)
     if workflow is not None:
-      workflow.updateRoleMappingsFor(self)
+      changed = workflow.updateRoleMappingsFor(self)
+      if changed:
+        self.reindexObjectSecurity()
 
   # Template Management
   security.declareProtected(Permissions.View, 'getDocumentTemplateList')
-- 
2.30.9