Commit f888109e authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added module list introspection

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25699 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ac118109
...@@ -76,4 +76,26 @@ class IntrospectionTool(BaseTool): ...@@ -76,4 +76,26 @@ class IntrospectionTool(BaseTool):
return erp5_menu_dict return erp5_menu_dict
security.declareProtected('getModuleItemList', Permissions.AccessContentsInformation)
def getModuleItemList(self, user_name=_MARKER):
"""
Returns menu items for a given user
"""
portal = self.getPortalObject()
is_portal_manager = getToolByName(portal,
'portal_membership').checkPermission(Permissions.ManagePortal, self)
downgrade_authenticated_user = user_name is not _MARKER and is_portal_manager
if downgrade_authenticated_user:
# downgrade to desired user
original_security_manager = _setSuperSecurityManager(self, erp5_user_name)
# call the method implementing it
erp5_module_list = portal.ERP5Site_getModuleItemList()
if downgrade_authenticated_user:
# restore original Security Manager
setSecurityManager(original_security_manager)
return erp5_module_list
InitializeClass(IntrospectionTool) InitializeClass(IntrospectionTool)
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