Commit 8d2242c9 authored by Alexandre Boeglin's avatar Alexandre Boeglin

reverted previous patch: it is a bad idea to force reindexing on a site with

millions of objects.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12677 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bbb144a4
...@@ -47,7 +47,6 @@ from Products.ERP5Type.patches import CMFCoreSkinnable ...@@ -47,7 +47,6 @@ from Products.ERP5Type.patches import CMFCoreSkinnable
from Products.ERP5Type.patches import CMFCoreSkinsTool from Products.ERP5Type.patches import CMFCoreSkinsTool
from Products.ERP5Type.patches import OFSFolder from Products.ERP5Type.patches import OFSFolder
from Products.ERP5Type.patches import HTTPRequest from Products.ERP5Type.patches import HTTPRequest
from Products.ERP5Type.patches import RoleManager
# These symbols are required for backward compatibility # These symbols are required for backward compatibility
from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager from Products.ERP5Type.patches.PropertyManager import ERP5PropertyManager
......
##############################################################################
#
# 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
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