From 769fc1c904259a99847af00fe3107e64b6d5f65c Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Wed, 21 Feb 2007 17:50:37 +0000
Subject: [PATCH] Declare dynamic viewSearchRelatedDocumentDialog methods as
 public.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12942 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/SelectionTool.py | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/product/ERP5Form/SelectionTool.py b/product/ERP5Form/SelectionTool.py
index f0a8c98f14..bdcbe3a13d 100644
--- a/product/ERP5Form/SelectionTool.py
+++ b/product/ERP5Form/SelectionTool.py
@@ -1177,8 +1177,8 @@ class SelectionTool( UniqueObject, SimpleItem ):
               """
                 viewSearchRelatedDocumentDialog Wrapper
               """
-              LOG('SelectionTool.viewSearchRelatedDocumentDialogWrapper, kw',
-                  0, kw)
+#               LOG('SelectionTool.viewSearchRelatedDocumentDialogWrapper, kw',
+#                   0, kw)
               return self.viewSearchRelatedDocumentDialog(
                                    method_count, form_id,
                                    REQUEST=REQUEST, sub_index=sub_index, **kw)
@@ -1186,13 +1186,10 @@ class SelectionTool( UniqueObject, SimpleItem ):
                     viewSearchRelatedDocumentDialogWrapper)
 
             klass = aq_base(self).__class__
-            if hasattr(klass, 'security'):
-              from Products.ERP5Type import Permissions as ERP5Permissions
-              klass.security.declareProtected(ERP5Permissions.View, name)
-            else:
-              # XXX security declaration always failed....
-              LOG('WARNING ERP5Form SelectionTool, security not defined on',
-                  0, klass.__name__)
+            security_property_id = '%s__roles__' % (name, )
+            # Declare method as public
+            setattr(klass, security_property_id, None)
+
             return getattr(self, name)
         else:
           return aq_base_name
-- 
2.30.9