Commit 6f2dfc3a authored by Yusei Tahara's avatar Yusei Tahara

2008-1-30 Yusei

* *_getResourceItemList script should return values only which user can access.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18916 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6a910571
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
-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
......
143
\ No newline at end of file
147
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment