1

I am trying to build a custom folder listing with quick links to the document actions for the object in the folder.

To load the actions defined for a given object obj I do in a browser view for the folder:

portal_actions = getToolByName(self.context, 'portal_actions')
actions = portal_actions.listActionInfos(object=obj, categories=('object_buttons',))

But for some reason actions always contains only the Copy action. Delete object, Rename etc are missing. When using the Plone UI with the same user (Manager) I can access all actions for the object I.

Experimentation with new dummy actions has shown that the source of the problem must be the permission and condition checking listActionInfos performs. But here I'm stuck... Comparing the evaluation contexts used to check the permissions and condition expressions for the actions revealed no significant differences between the invocations from the browser view and the normal Plone UI for the object.

What could be the problem?

4

1 回答 1

0

我找到了问题的根源。

发布的代码工作得很好,但我已经设法说服 Zope 的安全机制使用与我认为的实际角色不同的、特权较低的角色。不知何故,在视图的方法中构建不同的浏览器视图对象__init__导致了这种奇怪的行为。

于 2014-12-17T18:56:54.180 回答