[Zope-PTK] Adding Portal error... (and user question)

Tres Seaver tseaver@palladion.com
Mon, 17 Apr 2000 07:28:10 -0500


Alexander Schonfeld wrote:
> 
> Hi,
> 
> I'm getting some kind of ZCatalog error about not being able to index:
> > /home/alex/src/Zope2/lib/python/Products/PTKBase/PortalCatalog.py(14)initialize()
> -> self._catalog.addIndex('_allowedRolesAndUsers', 'KeywordIndex')
>  10         def initialize(self):
>  11             # Reviewing indexes
>  12             self._catalog.addIndex('review_state', 'FieldIndex')
>  13             self._catalog.addIndex('Date', 'FieldIndex')
>  14  ->         self._catalog.addIndex('_allowedRolesAndUsers', 'KeywordIndex')
>  15             # Content indexes
> 
> The "_allowedRolesAndUsers" causes the error.  This is with new cvs'
> under linux.  Is it necessary that this be a private func?

Hmmm, I caused this "regression," fixing a potential security hole in the
Catalog machinery.  I checked the main Zope tree, but forgot to look at the PTK
for cases where "private" attributes/methods were indexed.  Sorry for the
oversight!

Mike, can we expose this method?

> 
> Totally separate question:
>         How is User data stored/indexed under zope.org?  Are things like
> "names" "emails" etc... properties of the users' folder?  Are they
> searchable through the catalog?
> 
> Thanks,
> 
> Alex.
> 
> ---
> Error Type: Invalid Index Name
> Error Value: Cannot index fields beginning with "_"
> Traceback (innermost last):
>   File /home/alex/src/Zope2/lib/python/ZPublisher/Publish.py, line 214, in publish_module
>   File /home/alex/src/Zope2/lib/python/ZPublisher/Publish.py, line 179, in publish
>   File /home/alex/src/Zope2/lib/python/Zope/__init__.py, line 211, in zpublisher_exception_hook
>   File /home/alex/src/Zope2/lib/python/ZPublisher/Publish.py, line 165, in publish
>   File /home/alex/src/Zope2/lib/python/ZPublisher/mapply.py, line 160, in mapply
>     (Object: Portal_add)
>   File /home/alex/src/Zope2/lib/python/ZPublisher/Publish.py, line 102, in call_object
>     (Object: Portal_add)
>   File /home/alex/src/Zope2/lib/python/OFS/DTMLMethod.py, line 156, in __call__
>     (Object: Portal_add)
>   File /home/alex/src/Zope2/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
>     (Object: Portal_add)
>   File /home/alex/src/Zope2/lib/python/DocumentTemplate/DT_With.py, line 148, in render
>     (Object: Portal.createInObjectManager(REQUEST['id'], REQUEST))
>   File /home/alex/src/Zope2/lib/python/Products/PTKDemo/Portal.py, line 80, in install
>     (Object: DemoPortalBase)
>   File /home/alex/src/Zope2/lib/python/Products/PTKBase/PortalCatalog.py, line 14, in initialize
>     (Object: ElementWithAttributes)
>   File /home/alex/src/Zope2/lib/python/Products/ZCatalog/Catalog.py, line 309, in addIndex
> Invalid Index Name: (see above)

Tres.
-- 
=========================================================
Tres Seaver  tseaver@digicool.com   tseaver@palladion.com