[Zope] inserting uncle into acquisition chain

Randall F. Kern randy@spoke.net
Mon, 26 Feb 2001 15:52:53 -0800


I've got an __of__ function:

	def __of__(self, parent):
		if not hasattr(self, 'aq_parent'):
			return ImplicitAcquisitionWrapper(self, parent)
		else:
			category =3D
parent.unrestrictedTraverse(self._category._path)
			return ImplicitAcquisitionWrapper(self,
category.__of__(parent))

The goal is to insert another object (self._category) into my objects
context (so security settings on the category can be inherited by this
object).

It mostly works, however the chain is broken above my containing parent:

	ob.aq_inner.aq_parent	--	is not a wrapper

This results in all kinds of failures in ZopeSecurityPolicy.validate.


Any suggestions?  I still don't fully understand how this is supposed to
work.

Thanks,
-Randy