我在使用 getInfoFor
方法访问 review_history 时遇到问题,示例代码如下:
<div tal:define = "review_history python:wtool.getInfoFor(here, 'review_history', []);
review_history python: portal.reverseList(review_history)"
tal:repeat="items review_history">
<span tal:content="python: review_history" />
</div>
当我登录系统时,我可以看到 review_history 变量的内容,但是当我以未注册用户的身份查看时,我看到的只是一个空列表。有没有人遇到过这个问题,有没有办法修改它,以便每个人都可以使用?
最佳答案
您想要做的是调整工作流程,或者更好的是创建自定义工作流程。在此工作流程中,您可以管理内容的权限,并添加允许匿名用户查看对象的历史记录。 (不要忘记将新工作流程应用到您想要向匿名用户提供其历史记录的内容类型。)
看看Creating Workflows in Plone或Understanding permissions and security在plone.org上。这些页面应该会让您朝着正确的方向前进。
关于workflow - 如何访问 Anonymous 的 review_history,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2273707/