accidental acquisition

Bug #143403 reported by Victor Safronovich
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Low
Unassigned

Bug Description

AccessControl.Owned.changeOwnership method has accidental acquisition of the 'objectValues' method from parent containers which led to recursively changing of every parent's child object owner. This is bad for class that does not inherited from Item|SimpleItem, where objectValues has been defined as dirty hack. Upload may fix this problem.

Tags: bug zope
Revision history for this message
Victor Safronovich (suvit) wrote :
Revision history for this message
Tres Seaver (tseaver) wrote :

The patch looks reasonable. It needs a test.

BTW, defining 'objectValues' (and 'objectIds' / 'objectItems') as
returning empty sequences for a leaf object is not a "dirty hack": it
is a classic application of the "composite pattern"[1]. Having leaves
share the abstract container interface makes writing recursive code
vastly simpler. I strongly doubt that this is the only place in the
Zope2 codebase which interacts badly with sub-objects which do not define
those methods.

[1] http://en.wikipedia.org/wiki/Composite_pattern

Changed in zope2:
status: New → Triaged
Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

Added a test and checked in:

Zope 2.12 branch: http://svn.zope.org/?rev=113560&view=rev

Zope trunk: http://svn.zope.org/?rev=113561&view=rev

Changed in zope2:
status: Triaged → Fix Committed
assignee: nobody → Jens Vagelpohl (jens-dataflake)
Changed in zope2:
milestone: none → 2.12.8
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.