Commit 18590112 authored by Jérome Perrin's avatar Jérome Perrin

In Folder_delete, use...

In Folder_delete, use portal_categories.getRelatedPropertyList(property_name='relative_url') instead of [related_object.getRelativeUrl() for related_object in portal_categories.getRelatedValueList()] to prevent Unauthorized that may happen while getting attribute from related_object in restricted environment.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23743 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f284aa2b
...@@ -70,12 +70,12 @@ REQUEST=context.REQUEST\n ...@@ -70,12 +70,12 @@ REQUEST=context.REQUEST\n
qs = \'\'\n qs = \'\'\n
ret_url = \'\'\n ret_url = \'\'\n
\n \n
getRelatedPropertyList = portal.portal_categories.getRelatedPropertyList\n
def Object_hasRelation(obj):\n def Object_hasRelation(obj):\n
# Check if there is some related objets.\n # Check if there is some related objets.\n
result = 0\n result = 0\n
for o in obj.getIndexableChildValueList():\n for o in obj.getIndexableChildValueList():\n
for related in obj.portal_categories.getRelatedValueList(o):\n for related_url in getRelatedPropertyList(o, property_name=\'relative_url\'):\n
related_url = related.getRelativeUrl()\n
if related_url.startswith(obj.getRelativeUrl()):\n if related_url.startswith(obj.getRelativeUrl()):\n
continue\n continue\n
elif related_url.startswith(\'portal_simulation\'):\n elif related_url.startswith(\'portal_simulation\'):\n
...@@ -243,6 +243,7 @@ return REQUEST.RESPONSE.redirect("%s%s" % (ret_url, qs))\n ...@@ -243,6 +243,7 @@ return REQUEST.RESPONSE.redirect("%s%s" % (ret_url, qs))\n
<string>REQUEST</string> <string>REQUEST</string>
<string>qs</string> <string>qs</string>
<string>ret_url</string> <string>ret_url</string>
<string>getRelatedPropertyList</string>
<string>Object_hasRelation</string> <string>Object_hasRelation</string>
<string>message</string> <string>message</string>
<string>None</string> <string>None</string>
......
962 963
\ 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