From 27f2147fa808adc028e0c464bcb02ada58bf643d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 10 Aug 2006 14:44:15 +0000
Subject: [PATCH] remove assignRoleToSecurityGroupOnParent, if
 assignRoleToSecurityGroup use a good security declaration, this is not
 needed.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9134 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../scripts/Parent_updateAllLocalRoles.xml          |  2 +-
 product/ERP5/Document/RoleDefinition.py             | 13 -------------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/local_permission_interaction_workflow/scripts/Parent_updateAllLocalRoles.xml b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/local_permission_interaction_workflow/scripts/Parent_updateAllLocalRoles.xml
index 6c9bf256c1..c5f6ba9730 100644
--- a/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/local_permission_interaction_workflow/scripts/Parent_updateAllLocalRoles.xml
+++ b/bt5/erp5_dms/WorkflowTemplateItem/portal_workflow/local_permission_interaction_workflow/scripts/Parent_updateAllLocalRoles.xml
@@ -68,7 +68,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value><string>state_change[\'object\'].assignRoleToSecurityGroupOnParent()\n
+            <value><string>state_change[\'object\'].aq_inner.aq_parent.assignRoleToSecurityGroup()\n
 </string> </value>
         </item>
         <item>
diff --git a/product/ERP5/Document/RoleDefinition.py b/product/ERP5/Document/RoleDefinition.py
index 42734efc58..1a38a8c8f1 100644
--- a/product/ERP5/Document/RoleDefinition.py
+++ b/product/ERP5/Document/RoleDefinition.py
@@ -26,11 +26,8 @@
 ##############################################################################
 
 from AccessControl import ClassSecurityInfo
-from Acquisition import aq_parent
-from Acquisition import aq_inner
 from Products.CMFCore.utils import getToolByName
 from Products.CMFCore.WorkflowCore import WorkflowMethod
-
 from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
 from Products.ERP5Type.XMLObject import XMLObject
 
@@ -52,13 +49,3 @@ class RoleDefinition(XMLObject):
                       , PropertySheet.DublinCore
                       , PropertySheet.RoleDefinition
                       )
-
-    security.declareProtected(Permissions.ModifyPortalContent,
-                             'assignRoleToSecurityGroupOnParent')
-    def assignRoleToSecurityGroupOnParent(self, **kw):
-      """Assign roles to security group on the parent.
-
-      We redefine this method here, because we want the security check to be
-      performed on the role definition object itself, and not the parent. """
-      aq_parent(aq_inner(self)).assignRoleToSecurityGroup(**kw)
-
-- 
2.30.9