diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkPermission.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkPermission.xml index addf504aec5acf3a50f6b3bd06069b9131a802ab..c0964309ff5443b1ce30b829c9d99a6523d9286b 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkPermission.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_checkPermission.xml @@ -55,12 +55,17 @@ <key> <string>_body</string> </key> <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 -portal = context.getPortalObject()\n -ob = portal.restrictedTraverse(path, None)\n -if ob is not None:\n - if portal.portal_membership.checkPermission(permission, ob):\n - return 1\n -return 0\n +cache = container.REQUEST.other\n +try:\n + return cache[(script.getId(), path, permission)]\n +except KeyError:\n + allowed = False\n + portal = context.getPortalObject()\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> </item> <item> @@ -100,10 +105,18 @@ return 0\n <string>path</string> <string>permission</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>portal</string> <string>None</string> <string>ob</string> + <string>_write_</string> </tuple> </value> </item> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 029aeb486f9583f08c53e28fae0e84633fcbe4f9..1d1a6f5557ae01c74afcc73d3b97ad4895c8ba76 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -1474 \ No newline at end of file +1475 \ No newline at end of file