def restorePloneTool(context): portal = getToolByName(context, 'portal_url').getPortalObject() tool = getToolByName(portal, "plone_utils") if tool.meta_type == 'PlonePAS Utilities Tool': from Products.CMFPlone.PloneTool import PloneTool from Products.CMFDefault.Portal import CMFSite # PloneSite has its own security check for manage_delObjects which # breaks in the test runner. So we bypass this check. CMFSite.manage_delObjects(portal, ['plone_utils']) portal._setObject(PloneTool.id, PloneTool()) logger.info("Replaced obsolete PlonePAS version of plone tool " "with the normal one.")
def manage_delObjects(self, ids=[], REQUEST=None): """We need to enforce security.""" if isinstance(ids, basestring): ids = [ids] for id in ids: item = self._getOb(id) if not _checkPermission(permissions.DeleteObjects, item): raise Unauthorized, ("Do not have permissions to remove this object") return CMFSite.manage_delObjects(self, ids, REQUEST=REQUEST)
def manage_delObjects(self, ids=None, REQUEST=None): """We need to enforce security.""" if ids is None: ids = [] if isinstance(ids, basestring): ids = [ids] for id in ids: item = self._getOb(id) if not _checkPermission(permissions.DeleteObjects, item): raise Unauthorized( "Do not have permissions to remove this object") return CMFSite.manage_delObjects(self, ids, REQUEST=REQUEST)