CatalogBrains.getObject and unrestricted code
In ZCatalog's brains, getObject currently does a restrictedTraverse to get the object. That's a problem for unrestricted code that needs to get to the object nevertheless, even if the user cannot get to it. For instance CMF is impacted, when it tries to reindex the security of all subobjects of a given object. Unless someone is opposed to it, I'll add a _getObject method that does an unrestrictedTraverse, and make CMF use it if available. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
--On Montag, 29. November 2004 18:15 Uhr +0100 Florent Guillaume <fg@nuxeo.com> wrote:
In ZCatalog's brains, getObject currently does a restrictedTraverse to get the object. That's a problem for unrestricted code that needs to get to the object nevertheless, even if the user cannot get to it.
For instance CMF is impacted, when it tries to reindex the security of all subobjects of a given object.
Unless someone is opposed to it, I'll add a _getObject method that does an unrestrictedTraverse, and make CMF use it if available.
There is already a collector issue #1534 where ChrisW tracked something down in Traversable.py. However I have no idea if this is true or related to the problem. Andreas
Yes, http://collector.zope.org/Zope/1534 is related. But in any case if getObject returns a subset of available objects (and None or Unauthorized for the others), we still needs a _getObject method that returns all of them, for unrestricted code. Florent Andreas Jung wrote:
--On Montag, 29. November 2004 18:15 Uhr +0100 Florent Guillaume <fg@nuxeo.com> wrote:
In ZCatalog's brains, getObject currently does a restrictedTraverse to get the object. That's a problem for unrestricted code that needs to get to the object nevertheless, even if the user cannot get to it.
For instance CMF is impacted, when it tries to reindex the security of all subobjects of a given object.
Unless someone is opposed to it, I'll add a _getObject method that does an unrestrictedTraverse, and make CMF use it if available.
There is already a collector issue #1534 where ChrisW tracked something down in Traversable.py. However I have no idea if this is true or related to the problem.
Andreas
-- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
In article <41AB5920.70405@nuxeo.com>, Florent Guillaume <fg@nuxeo.com> wrote:
In ZCatalog's brains, getObject currently does a restrictedTraverse to get the object. That's a problem for unrestricted code that needs to get to the object nevertheless, even if the user cannot get to it.
For instance CMF is impacted, when it tries to reindex the security of all subobjects of a given object.
Unless someone is opposed to it, I'll add a _getObject method that does an unrestrictedTraverse, and make CMF use it if available.
Florent
getObject must be restricted since it can be called by untrusted code. It has been argued that it is currently too restrictive, and it should only validate the leaf object, but nothing has been done about this AFAIK. You can work around this issue by using:: unrestrictedTraverse(brain.getPath()) A (restricted) convenience method to do this could be added, but it doesn't really seem worth the effort IMO. -Casey
participants (3)
-
Andreas Jung -
Casey Duncan -
Florent Guillaume