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 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n ...@@ -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 resources for events. It is intended to be used\n
by ListField instances.\n by ListField instances.\n
"""\n """\n
\n from zExceptions import Unauthorized\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
def getResourceItemList():\n def getResourceItemList():\n
result = []\n result = []\n
url_list = context.portal_preferences.getPreferredCampaignResourceList()\n url_list = context.portal_preferences.getPreferredCampaignResourceList()\n
for url in url_list:\n for url in url_list:\n
resource_value = context.getPortalObject().restrictedTraverse(url)\n try:\n
result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\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 return result\n
\n \n
getResourceItemList = CachingMethod(getResourceItemList, \n getResourceItemList = CachingMethod(getResourceItemList, \n
...@@ -131,6 +131,8 @@ return getResourceItemList()\n ...@@ -131,6 +131,8 @@ return getResourceItemList()\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>zExceptions</string>
<string>Unauthorized</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>getResourceItemList</string> <string>getResourceItemList</string>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n ...@@ -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 resources for events. It is intended to be used\n
by ListField instances.\n by ListField instances.\n
"""\n """\n
\n from zExceptions import Unauthorized\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
def getResourceItemList():\n def getResourceItemList():\n
result = []\n result = []\n
url_list = context.portal_preferences.getPreferredEventResourceList()\n url_list = context.portal_preferences.getPreferredEventResourceList()\n
for url in url_list:\n for url in url_list:\n
resource_value = context.getPortalObject().restrictedTraverse(url)\n try:\n
result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\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 return result\n
\n \n
getResourceItemList = CachingMethod(getResourceItemList, \n getResourceItemList = CachingMethod(getResourceItemList, \n
...@@ -131,6 +131,8 @@ return getResourceItemList()\n ...@@ -131,6 +131,8 @@ return getResourceItemList()\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>zExceptions</string>
<string>Unauthorized</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>getResourceItemList</string> <string>getResourceItemList</string>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n ...@@ -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 resources for events. It is intended to be used\n
by ListField instances.\n by ListField instances.\n
"""\n """\n
\n from zExceptions import Unauthorized\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
def getResourceItemList():\n def getResourceItemList():\n
result = []\n result = []\n
url_list = context.portal_preferences.getPreferredMeetingResourceList()\n url_list = context.portal_preferences.getPreferredMeetingResourceList()\n
for url in url_list:\n for url in url_list:\n
resource_value = context.getPortalObject().restrictedTraverse(url)\n try:\n
result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\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 return result\n
\n \n
getResourceItemList = CachingMethod(getResourceItemList, \n getResourceItemList = CachingMethod(getResourceItemList, \n
...@@ -131,6 +131,8 @@ return getResourceItemList()\n ...@@ -131,6 +131,8 @@ return getResourceItemList()\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>zExceptions</string>
<string>Unauthorized</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>getResourceItemList</string> <string>getResourceItemList</string>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n ...@@ -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 resources for events. It is intended to be used\n
by ListField instances.\n by ListField instances.\n
"""\n """\n
\n from zExceptions import Unauthorized\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
def getResourceItemList():\n def getResourceItemList():\n
result = []\n result = []\n
url_list = context.portal_preferences.getPreferredSaleOpportunityResourceList()\n url_list = context.portal_preferences.getPreferredSaleOpportunityResourceList()\n
for url in url_list:\n for url in url_list:\n
resource_value = context.getPortalObject().restrictedTraverse(url)\n try:\n
result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\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 return result\n
\n \n
getResourceItemList = CachingMethod(getResourceItemList, \n getResourceItemList = CachingMethod(getResourceItemList, \n
...@@ -131,6 +131,8 @@ return getResourceItemList()\n ...@@ -131,6 +131,8 @@ return getResourceItemList()\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>zExceptions</string>
<string>Unauthorized</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>getResourceItemList</string> <string>getResourceItemList</string>
......
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -73,15 +70,18 @@ This script returns the list of items based on the preferred\n ...@@ -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 resources for events. It is intended to be used\n
by ListField instances.\n by ListField instances.\n
"""\n """\n
\n from zExceptions import Unauthorized\n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
\n \n
def getResourceItemList():\n def getResourceItemList():\n
result = []\n result = []\n
url_list = context.portal_preferences.getPreferredSupportRequestResourceList()\n url_list = context.portal_preferences.getPreferredSupportRequestResourceList()\n
for url in url_list:\n for url in url_list:\n
resource_value = context.getPortalObject().restrictedTraverse(url)\n try:\n
result.append((resource_value.getTranslatedTitle(), resource_value.getRelativeUrl()))\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 return result\n
\n \n
getResourceItemList = CachingMethod(getResourceItemList, \n getResourceItemList = CachingMethod(getResourceItemList, \n
...@@ -131,6 +131,8 @@ return getResourceItemList()\n ...@@ -131,6 +131,8 @@ return getResourceItemList()\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>zExceptions</string>
<string>Unauthorized</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>getResourceItemList</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. * Added mimetypes_registry, portal_transforms in Tools. Please use revision 18669 or newer of ERP5Type.
2007-10-30 yo 2007-10-30 yo
......
143 147
\ No newline at end of file \ 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