Commit 7611d225 authored by Romain Courteaud's avatar Romain Courteaud

Only display modules if the user has the View permission.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10341 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cfd5fd01
......@@ -71,7 +71,7 @@
<value> <string>from Products.ERP5Type.Cache import CachingMethod, clearCache\n
from ZODB.POSException import ConflictError\n
\n
user = context.portal_membership.getAuthenticatedMember().getUserName()\n
user = context.portal_membership.getAuthenticatedMember()\n
\n
portal = context.getPortalObject()\n
\n
......@@ -82,10 +82,11 @@ def getModuleItemList(user=None, portal_path=None):\n
for module_id in portal.objectIds(\'ERP5 Folder\'):\n
try:\n
module = portal[module_id]\n
url = module.getPath()\n
label = module.getTitleOrId()\n
label = gettext(label)\n
item_list.append((label, url))\n
if user.has_permission(\'View\', module):\n
url = module.getPath()\n
label = module.getTitleOrId()\n
label = gettext(label)\n
item_list.append((label, url))\n
except ConflictError : raise\n
except: pass\n
except ConflictError : raise\n
......
77
\ No newline at end of file
80
\ 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