Commit 57934b32 authored by Jérome Perrin's avatar Jérome Perrin

Don't cache here. We could cache in listFilteredActionsFor instead

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32857 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ba549892
...@@ -55,17 +55,12 @@ ...@@ -55,17 +55,12 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># Check for a permission on an object specified by a given path\n <value> <string># Check for a permission on an object specified by a given path\n
# for current user. Return true only if the user is allowed.\n # for current user. Return true only if the user is allowed.\n
cache = container.REQUEST.other\n \n
try:\n portal = context.getPortalObject()\n
return cache[(script.getId(), path, permission)]\n ob = portal.restrictedTraverse(path, None)\n
except KeyError:\n if ob is not None:\n
allowed = False\n return portal.portal_membership.checkPermission(permission, ob)\n
portal = context.getPortalObject()\n return False\n
ob = portal.restrictedTraverse(path, None)\n
if ob is not None:\n
allowed = portal.portal_membership.checkPermission(permission, ob)\n
cache[(script.getId(), path, permission)] = allowed\n
return allowed\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -105,18 +100,11 @@ except KeyError:\n ...@@ -105,18 +100,11 @@ except KeyError:\n
<string>path</string> <string>path</string>
<string>permission</string> <string>permission</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>container</string>
<string>cache</string>
<string>_getitem_</string>
<string>script</string>
<string>KeyError</string>
<string>False</string>
<string>allowed</string>
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>None</string> <string>None</string>
<string>ob</string> <string>ob</string>
<string>_write_</string> <string>False</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
1481 1484
\ 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