diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Campaign_getResourceItemList.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Campaign_getResourceItemList.xml index be1694e584e6e98221a7534d1729d6373e9c34d9..ffdede613e39b6530856be3d7af17677b0a5d7c9 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Campaign_getResourceItemList.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Campaign_getResourceItemList.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n resources for events. It is intended to be used\n by ListField instances.\n """\n -\n +from zExceptions import Unauthorized\n from Products.ERP5Type.Cache import CachingMethod\n \n def getResourceItemList():\n result = []\n url_list = context.portal_preferences.getPreferredCampaignResourceList()\n for url in url_list:\n - resource_value = context.getPortalObject().restrictedTraverse(url)\n - result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + try:\n + resource_value = context.getPortalObject().restrictedTraverse(url)\n + result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + except Unauthorized:\n + pass\n return result\n \n getResourceItemList = CachingMethod(getResourceItemList, \n @@ -131,6 +131,8 @@ return getResourceItemList()\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>zExceptions</string> + <string>Unauthorized</string> <string>Products.ERP5Type.Cache</string> <string>CachingMethod</string> <string>getResourceItemList</string> diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getResourceItemList.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getResourceItemList.xml index da9b837b04e664dc25bb775d01cb3e0d9c180e34..5da234b0da8d9505e0fd9c078d7d82818894c40c 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getResourceItemList.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getResourceItemList.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n resources for events. It is intended to be used\n by ListField instances.\n """\n -\n +from zExceptions import Unauthorized\n from Products.ERP5Type.Cache import CachingMethod\n \n def getResourceItemList():\n result = []\n url_list = context.portal_preferences.getPreferredEventResourceList()\n for url in url_list:\n - resource_value = context.getPortalObject().restrictedTraverse(url)\n - result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + try:\n + resource_value = context.getPortalObject().restrictedTraverse(url)\n + result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + except Unauthorized:\n + pass\n return result\n \n getResourceItemList = CachingMethod(getResourceItemList, \n @@ -131,6 +131,8 @@ return getResourceItemList()\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>zExceptions</string> + <string>Unauthorized</string> <string>Products.ERP5Type.Cache</string> <string>CachingMethod</string> <string>getResourceItemList</string> diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Meeting_getResourceItemList.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Meeting_getResourceItemList.xml index 4177d465f946967e5f68ca9f1350637f41c5a848..f3886c61e7b6b88b56f49bc24e3b2934c6dfd15e 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Meeting_getResourceItemList.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Meeting_getResourceItemList.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n resources for events. It is intended to be used\n by ListField instances.\n """\n -\n +from zExceptions import Unauthorized\n from Products.ERP5Type.Cache import CachingMethod\n \n def getResourceItemList():\n result = []\n url_list = context.portal_preferences.getPreferredMeetingResourceList()\n for url in url_list:\n - resource_value = context.getPortalObject().restrictedTraverse(url)\n - result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + try:\n + resource_value = context.getPortalObject().restrictedTraverse(url)\n + result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + except Unauthorized:\n + pass\n return result\n \n getResourceItemList = CachingMethod(getResourceItemList, \n @@ -131,6 +131,8 @@ return getResourceItemList()\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>zExceptions</string> + <string>Unauthorized</string> <string>Products.ERP5Type.Cache</string> <string>CachingMethod</string> <string>getResourceItemList</string> diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SaleOpportunity_getResourceItemList.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SaleOpportunity_getResourceItemList.xml index 78d9bc583d1a72a68f3e61c84c044b4ec11ae29c..d22c0b8ed14a9d91409a2c1fb0b0870c0065ad1a 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SaleOpportunity_getResourceItemList.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SaleOpportunity_getResourceItemList.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n resources for events. It is intended to be used\n by ListField instances.\n """\n -\n +from zExceptions import Unauthorized\n from Products.ERP5Type.Cache import CachingMethod\n \n def getResourceItemList():\n result = []\n url_list = context.portal_preferences.getPreferredSaleOpportunityResourceList()\n for url in url_list:\n - resource_value = context.getPortalObject().restrictedTraverse(url)\n - result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + try:\n + resource_value = context.getPortalObject().restrictedTraverse(url)\n + result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + except Unauthorized:\n + pass\n return result\n \n getResourceItemList = CachingMethod(getResourceItemList, \n @@ -131,6 +131,8 @@ return getResourceItemList()\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>zExceptions</string> + <string>Unauthorized</string> <string>Products.ERP5Type.Cache</string> <string>CachingMethod</string> <string>getResourceItemList</string> diff --git a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SupportRequest_getResourceItemList.xml b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SupportRequest_getResourceItemList.xml index bc4bde0e895d5a9260d52e828928deb36f58912e..fb9f8a300d212c9eab7bcf8f98788111bde5252d 100644 --- a/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SupportRequest_getResourceItemList.xml +++ b/bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/SupportRequest_getResourceItemList.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n resources for events. It is intended to be used\n by ListField instances.\n """\n -\n +from zExceptions import Unauthorized\n from Products.ERP5Type.Cache import CachingMethod\n \n def getResourceItemList():\n result = []\n url_list = context.portal_preferences.getPreferredSupportRequestResourceList()\n for url in url_list:\n - resource_value = context.getPortalObject().restrictedTraverse(url)\n - result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + try:\n + resource_value = context.getPortalObject().restrictedTraverse(url)\n + result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\n + except Unauthorized:\n + pass\n return result\n \n getResourceItemList = CachingMethod(getResourceItemList, \n @@ -131,6 +131,8 @@ return getResourceItemList()\n <key> <string>co_varnames</string> </key> <value> <tuple> + <string>zExceptions</string> + <string>Unauthorized</string> <string>Products.ERP5Type.Cache</string> <string>CachingMethod</string> <string>getResourceItemList</string> diff --git a/bt5/erp5_crm/bt/change_log b/bt5/erp5_crm/bt/change_log index 4b4db207f130b52597a2756f92ecc3310cf37ef8..9a77f32c865c7e499abc3bfc856e322e719e9da4 100644 --- a/bt5/erp5_crm/bt/change_log +++ b/bt5/erp5_crm/bt/change_log @@ -1,4 +1,8 @@ --2008-1-11 Yusei +2008-1-30 Yusei +* *_getResourceItemList script should +return values only which user can access. + +2008-1-11 Yusei * Added mimetypes_registry, portal_transforms in Tools. Please use revision 18669 or newer of ERP5Type. 2007-10-30 yo diff --git a/bt5/erp5_crm/bt/revision b/bt5/erp5_crm/bt/revision index aa59885c836ad82e8a621dbdde0bf9fb7a80c346..5d1277e790328f9e133a3d83d800e37fd6ac82ed 100644 --- a/bt5/erp5_crm/bt/revision +++ b/bt5/erp5_crm/bt/revision @@ -1 +1 @@ -143 \ No newline at end of file +147 \ No newline at end of file diff --git a/bt5/erp5_crm/bt/template_catalog_scriptable_key_list b/bt5/erp5_crm/bt/template_catalog_scriptable_key_list new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391