Roché Compaan wrote:
+        obj = self.aq_parent.unrestrictedTraverse(self.getPath(), None)
+        if obj and securityManager.validate(obj, obj, None, None):
+            return obj
+        else:
+            return None


Urm, Roche, doesn't the above seek to do exactly what...

return self.aq_parent.restrictedTraverse(self.getPath(), None)

...does?

The problem is that an error should be raised, Unauthorized in my opinion, rather than None being returned.

None should never be returned in place of a brain, although I'll soften that to say that if it does, it means something weird has happened (used to mean the object the catalog entry mapped to had gone away)

I think:

self.aq_parent.restrictedTraverse(self.getPath())

...should be fine, no?

Chris

--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to