[Erp5-report] r26663 - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplateItem/p...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 27 16:55:16 CEST 2009


Author: jerome
Date: Mon Apr 27 16:55:13 2009
New Revision: 26663

URL: http://svn.erp5.org?rev=26663&view=rev
Log:
Use getProperty to get the reference, because this document could not have
getReference method, and this method could be acquired. Also traverse from
portal when getting this document, to prevent having context in the acquisition
chain.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_asSecurityGroupId.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_asSecurityGroupId.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_asSecurityGroupId.xml?rev=26663&r1=26662&r2=26663&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_asSecurityGroupId.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Type_asSecurityGroupId.xml [utf8] Mon Apr 27 16:55:13 2009
@@ -88,6 +88,7 @@
 to a Person instance. This is useful to implement user based local role assignments\n
 instead of abstract security based local roles.\n
 """\n
+portal = context.getPortalObject()\n
 \n
 # sort the category list lexicographically\n
 # this prevents us to choose the exact order we want,\n
@@ -116,7 +117,7 @@
       else:\n
         is_child_category = 0\n
       category_path = \'%s/%s\' % (base_category, category)\n
-      category_object = context.portal_categories.getCategoryValue(category_path)\n
+      category_object = portal.portal_categories.getCategoryValue(category_path)\n
       if category_object in (None, \'\'):\n
         raise "SecurityRoleDefinitionError", "Category \'%s\' doesn\'t exist" % (category_path)\n
       portal_type = category_object.getPortalType()\n
@@ -126,12 +127,9 @@
         if user_name is not None: user_list.append(user_name)\n
       else:\n
         if portal_type == \'Category\':\n
-          category_code  = category_object.getCodification() or category_object.getId()\n
+          category_code = category_object.getCodification() or category_object.getId()\n
         else:\n
-          try:\n
-            category_code   = category_object.getReference() or category_object.getId()\n
-          except AttributeError:\n
-            category_code   = category_object.getId()\n
+          category_code = category_object.getProperty(\'reference\') or category_object.getId()\n
         if is_child_category: category_code += \'*\'\n
         associative_list.append(category_code)\n
     # Prevent making a cartesian product with an empty set\n
@@ -182,9 +180,11 @@
                           <tuple>
                             <string>category_order</string>
                             <string>kw</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
                             <string>None</string>
                             <string>list</string>
-                            <string>_getattr_</string>
                             <string>Products.ERP5Type.Utils</string>
                             <string>cartesianProduct</string>
                             <string>list_of_list</string>
@@ -198,12 +198,10 @@
                             <string>category</string>
                             <string>is_child_category</string>
                             <string>category_path</string>
-                            <string>context</string>
                             <string>category_object</string>
                             <string>portal_type</string>
                             <string>user_name</string>
                             <string>category_code</string>
-                            <string>AttributeError</string>
                             <string>_inplacevar_</string>
                             <string>append</string>
                             <string>$append0</string>

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=26663&r1=26662&r2=26663&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Mon Apr 27 16:55:13 2009
@@ -1,1 +1,1 @@
-1170
+1171




More information about the Erp5-report mailing list