提供一个接口和默认适配器,允许用户独立于视图权限搜索目录。
collective.allowsearch的Python项目详细描述
概述
提供一个接口和默认适配器,允许用户搜索 目录独立于视图权限。
安装
将此包添加到构建包或策略包,或添加zcml slug 给你的etc/site.zcml。
用法
只需标记您希望在匿名搜索中可见的任何内容 具有IAllowAnonymousSearchMarker接口的用户。
这可以通过编程或使用zcml完成,例如:
<configure xmlns="http://namespaces.zope.org/zope" xmlns:five="http://namespaces.zope.org/five" i18n_domain="collective.allowsearch"> <include package="collective.allowsearch" /> <!-- EXAMPLE: Allow all ATDocument objects to be found by Anonymous users. NOTE: This does _NOT_ change the View permissions in any way. --> <five:implements class="Products.ATContentTypes.content.document.ATDocument" interface="collective.allowsearch.interfaces.IAllowAnonymousSearchMarker" /> </configure>
就这样。有关更多信息,请参阅包的doctest。