From a46b931a057e1469f998342b3cacf7a3393af9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Tue, 22 Jul 2008 17:27:34 +0000 Subject: [PATCH] Only show sections the current user can view in Base_getSectionUidListForSectionCategory. Don't use a cache here git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22621 20353a03-c40f-0410-a6d1-a30d3c3de9de --- ...se_getSectionUidListForSectionCategory.xml | 24 ++++++++----------- bt5/erp5_base/bt/revision | 2 +- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionUidListForSectionCategory.xml b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionUidListForSectionCategory.xml index b5bd834271..4efbfa6887 100644 --- a/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionUidListForSectionCategory.xml +++ b/bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getSectionUidListForSectionCategory.xml @@ -65,20 +65,16 @@ </item> <item> <key> <string>_body</string> </key> - <value> <string>"""Returns the list of section_uid for a section_category.\n + <value> <string>"""Returns the list of section_uid for a group section_category.\n \n This will only return organisation member of this section category.\n """\n portal = context.getPortalObject()\n \n -def getSectionUidListForSectionCategory(section_category):\n - section = portal.portal_categories.restrictedTraverse(section_category)\n - return [x.getUid() for x in section.getGroupRelatedValueList(portal_type=\'Organisation\')]\n -\n -from Products.ERP5Type.Cache import CachingMethod\n -getCurrencyForSection = CachingMethod(getSectionUidListForSectionCategory,\n - id=script.getId())\n -return getSectionUidListForSectionCategory(section_category)\n +section = portal.portal_categories.restrictedTraverse(section_category)\n +return [x.getUid() for x in\n + section.getGroupRelatedValueList(portal_type=\'Organisation\',\n + checked_permission=\'View\')]\n </string> </value> </item> <item> @@ -131,11 +127,11 @@ return getSectionUidListForSectionCategory(section_category)\n <string>_getattr_</string> <string>context</string> <string>portal</string> - <string>getSectionUidListForSectionCategory</string> - <string>Products.ERP5Type.Cache</string> - <string>CachingMethod</string> - <string>script</string> - <string>getCurrencyForSection</string> + <string>section</string> + <string>append</string> + <string>$append0</string> + <string>_getiter_</string> + <string>x</string> </tuple> </value> </item> diff --git a/bt5/erp5_base/bt/revision b/bt5/erp5_base/bt/revision index 2291c046ea..fd098d297e 100644 --- a/bt5/erp5_base/bt/revision +++ b/bt5/erp5_base/bt/revision @@ -1 +1 @@ -373 \ No newline at end of file +374 \ No newline at end of file -- 2.30.9