From: David G. <svn...@pl...> - 2008-07-02 05:13:32
|
Author: davisagli Date: Wed Jul 2 05:13:40 2008 New Revision: 21342 Modified: plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py Log: Only reindex security from update_inherit if the setting actually changed. Fixes #8194 and avoids a potentially expensive extra reindex in many uses of the sharing tab. We could perhaps do even better and combine the reindex with the one from update_role_settings, but that's probably a job for collective.indexing... Modified: plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py ============================================================================== --- plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py (original) +++ plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py Wed Jul 2 05:13:40 2008 @@ -415,13 +415,18 @@ if not portal_membership.checkPermission(permissions.ModifyPortalContent, context): raise Unauthorized + reindex = False if not status: + if not getattr(aq_base(context), '__ac_local_roles_block__', None): + reindex = True context.__ac_local_roles_block__ = True else: if getattr(aq_base(context), '__ac_local_roles_block__', None): + reindex = True context.__ac_local_roles_block__ = None - context.reindexObjectSecurity() + if reindex: + context.reindexObjectSecurity() @clearafter def update_role_settings(self, new_settings): |