Commit d03debfb authored by Rafael Monnerat's avatar Rafael Monnerat

Drop getToolByName usage.

parent 953e369c
...@@ -71,15 +71,16 @@ class IntrospectionTool(LogMixin, BaseTool): ...@@ -71,15 +71,16 @@ class IntrospectionTool(LogMixin, BaseTool):
Returns menu items for a given user Returns menu items for a given user
""" """
portal = self.getPortalObject() portal = self.getPortalObject()
is_portal_manager = getToolByName(portal, is_portal_manager = portal.portal_membership.checkPermission(\
'portal_membership').checkPermission(Permissions.ManagePortal, self) Permissions.ManagePortal, self)
downgrade_authenticated_user = user_name is not _MARKER and is_portal_manager downgrade_authenticated_user = user_name is not _MARKER and is_portal_manager
if downgrade_authenticated_user: if downgrade_authenticated_user:
# downgrade to desired user # downgrade to desired user
original_security_manager = _setSuperSecurityManager(self, user_name) original_security_manager = _setSuperSecurityManager(self, user_name)
# call the method implementing it # call the method implementing it
erp5_menu_dict = getToolByName(portal, 'portal_actions').listFilteredActionsFor(portal) erp5_menu_dict = portal.portal_actions.listFilteredActionsFor(portal)
if downgrade_authenticated_user: if downgrade_authenticated_user:
# restore original Security Manager # restore original Security Manager
...@@ -99,8 +100,9 @@ class IntrospectionTool(LogMixin, BaseTool): ...@@ -99,8 +100,9 @@ class IntrospectionTool(LogMixin, BaseTool):
Returns module items for a given user Returns module items for a given user
""" """
portal = self.getPortalObject() portal = self.getPortalObject()
is_portal_manager = getToolByName(portal, is_portal_manager = portal.portal_membership.checkPermission(
'portal_membership').checkPermission(Permissions.ManagePortal, self) Permissions.ManagePortal, self)
downgrade_authenticated_user = user_name is not _MARKER and is_portal_manager downgrade_authenticated_user = user_name is not _MARKER and is_portal_manager
if downgrade_authenticated_user: if downgrade_authenticated_user:
# downgrade to desired user # downgrade to desired user
......
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