[ZCM] [ZC] 1534/ 1 Request "Catalog Brains's getObject bug"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Wed Oct 13 04:33:52 EDT 2004


Issue #1534 Update (Request) "Catalog Brains's getObject bug"
 Status Accepted, Zope/bug medium
To followup, visit:
  http://zope.org/Collectors/Zope/1534

==============================================================
= Request - Entry #1 by chrisw on Oct 13, 2004 4:33 am

 Status: Pending => Accepted

 Supporters added: Caseman

ZCatalog brains' getObject method is now very simply implemented, but in a way that can lead to end user confusion.

The intent is to return None for a brain that no longer maps to an object, but the impementation is such that it also returns None when the user doing the getObject isn't allowed to access the object being mapped to.

This in itself is confusing, an Unauthorized should be raised instead of None being returned.

However, more seriously, it means that unrestricted code that calls getObject no longer works since there may not be an active security manager.

FWIW, the (ugly) workaround I'm currently using is:

container.unrestrictedTraverse(brain.getPath(),None)

...in place of any brain.getObject()'s
==============================================================



More information about the Zope-Collector-Monitor mailing list