From d8e5499f20d065abafc2a4064498943fbc237154 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Tue, 5 Feb 2008 17:47:45 +0000
Subject: [PATCH] updateLocalRolesOnSecurityGroups needs to be unrestricted on
 ERP5Type instead of Base.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19071 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py     | 4 ----
 product/ERP5Type/ERP5Type.py | 8 +++++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 424cffe002..ed67a05036 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -3109,10 +3109,6 @@ class Base( CopyContainer,
     """Assign Local Roles to Groups on self, based on Portal Type Role
     Definitions and "ERP5 Role Definition" objects contained inside self.
     """
-    updateLocalRolesOnSecurityGroups = UnrestrictedMethod(self._updateLocalRolesOnSecurityGroups)
-    return updateLocalRolesOnSecurityGroups(**kw)
-
-  def _updateLocalRolesOnSecurityGroups(self, **kw):
     self._getTypesTool().getTypeInfo(self)\
                           .updateLocalRolesOnSecurityGroups(self, **kw)
 
diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py
index 28d40294ad..3de6fcee7c 100644
--- a/product/ERP5Type/ERP5Type.py
+++ b/product/ERP5Type/ERP5Type.py
@@ -39,6 +39,7 @@ from Products.CMFCore.utils import _checkPermission
 from Products.ERP5Type import PropertySheet
 from Products.ERP5Type import _dtmldir
 from Products.ERP5Type import Permissions
+from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
 
 # Security uses ERP5Security by default
 try:
@@ -450,7 +451,12 @@ class ERP5TypeInformation( FactoryTypeInformation,
       return factory_method(portal, id).propertyMap()
 
     security.declarePrivate('updateLocalRolesOnSecurityGroups')
-    def updateLocalRolesOnSecurityGroups(self, ob, user_name=None,
+    def updateLocalRolesOnSecurityGroups(self, *args, **kw):
+      updateLocalRolesOnSecurityGroups = \
+        UnrestrictedMethod(self._updateLocalRolesOnSecurityGroups)
+      return updateLocalRolesOnSecurityGroups(*args, **kw)
+
+    def _updateLocalRolesOnSecurityGroups(self, ob, user_name=None,
                                          reindex=True):
       """
         Assign Local Roles to Groups on object 'ob', based on Portal Type Role
-- 
2.30.9