diff --git a/product/ERP5Type/ZopePatch.py b/product/ERP5Type/ZopePatch.py index e7ea5ad36d17143fd462139a3201c62c9e54d266..d695af278469909f595cbf7f8e70afaf598c2ad4 100644 --- a/product/ERP5Type/ZopePatch.py +++ b/product/ERP5Type/ZopePatch.py @@ -47,7 +47,6 @@ from Products.ERP5Type.patches import CMFCoreSkinnable from Products.ERP5Type.patches import CMFCoreSkinsTool from Products.ERP5Type.patches import OFSFolder from Products.ERP5Type.patches import HTTPRequest -from Products.ERP5Type.patches import RoleManager # These symbols are required for backward compatibility from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager diff --git a/product/ERP5Type/patches/RoleManager.py b/product/ERP5Type/patches/RoleManager.py deleted file mode 100644 index eb09956d28be1785eac693faf12c2cb5a820001c..0000000000000000000000000000000000000000 --- a/product/ERP5Type/patches/RoleManager.py +++ /dev/null @@ -1,77 +0,0 @@ -############################################################################## -# -# Copyright (c) 2001, 2002 Zope Corporation and Contributors. -# Copyright (c) 2002,2005 Nexedi SARL and Contributors. All Rights Reserved. -# All Rights Reserved. -# -# This software is subject to the provisions of the Zope Public License, -# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. -# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED -# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS -# FOR A PARTICULAR PURPOSE -# -############################################################################## - -# monkeypatch to have role mathods call reindex - -# make sure NuxUserGroups monkeypatches RoleManager first -try: - import NuxUserGroups -except ImportError: - pass - -from AccessControl.Role import RoleManager - -# Security and catalog reindexing triggers -def manage_addLocalRoles(self, userid, roles, REQUEST=None): - "reindex after role update" - RoleManager.old_manage_addLocalRoles(self, userid, roles, REQUEST=REQUEST) - reindex_method = getattr(self, 'recursiveReindexObject', None) - if reindex_method is not None: reindex_method() - -def manage_setLocalRoles(self, userid, roles, REQUEST=None): - "reindex after role update" - RoleManager.old_manage_setLocalRoles(self, userid, roles, REQUEST=REQUEST) - reindex_method = getattr(self, 'recursiveReindexObject', None) - if reindex_method is not None: reindex_method() - -def manage_delLocalRoles(self, userid, REQUEST=None): - "reindex after role update" - RoleManager.old_manage_delLocalRoles(self, userid, REQUEST=REQUEST) - reindex_method = getattr(self, 'recursiveReindexObject', None) - if reindex_method is not None: reindex_method() - -def manage_addLocalGroupRoles(self, groupid, roles, REQUEST=None): - "reindex after role update" - RoleManager.old_manage_addLocalGroupRoles(self, groupid, roles, REQUEST=REQUEST) - reindex_method = getattr(self, 'recursiveReindexObject', None) - if reindex_method is not None: reindex_method() - -def manage_setLocalGroupRoles(self, groupid, roles, REQUEST=None): - "reindex after role update" - RoleManager.old_manage_setLocalGroupRoles(self, groupid, roles, REQUEST=REQUEST) - reindex_method = getattr(self, 'recursiveReindexObject', None) - if reindex_method is not None: reindex_method() - -def manage_delLocalGroupRoles(self, groupids, REQUEST=None): - "reindex after role update" - RoleManager.old_manage_delLocalGroupRoles(self, groupids, REQUEST=REQUEST) - reindex_method = getattr(self, 'recursiveReindexObject', None) - if reindex_method is not None: reindex_method() - -RoleManager.old_manage_addLocalRoles = RoleManager.manage_addLocalRoles -RoleManager.manage_addLocalRoles = manage_addLocalRoles -RoleManager.old_manage_setLocalRoles = RoleManager.manage_setLocalRoles -RoleManager.manage_setLocalRoles = manage_setLocalRoles -RoleManager.old_manage_delLocalRoles = RoleManager.manage_delLocalRoles -RoleManager.manage_delLocalRoles = manage_delLocalRoles - -if getattr(RoleManager, 'manage_addLocalGroupRoles', None) is not None: - RoleManager.old_manage_addLocalGroupRoles = RoleManager.manage_addLocalGroupRoles - RoleManager.manage_addLocalGroupRoles = manage_addLocalGroupRoles - RoleManager.old_manage_setLocalGroupRoles = RoleManager.manage_setLocalGroupRoles - RoleManager.manage_setLocalGroupRoles = manage_setLocalGroupRoles - RoleManager.old_manage_delLocalGroupRoles = RoleManager.manage_delLocalGroupRoles - RoleManager.manage_delLocalGroupRoles = manage_delLocalGroupRoles -