[Product-Developers] ZCML-registered template overrules read_permission
Kees Hink
hink at gw20e.com
Wed Dec 16 16:47:43 UTC 2009
I have, on an Archetypes content type, a field 'instruction' with
'read_permission = "Set own password"'. The base_view template respects this
and does not show the field to Anonymous users.
However, my view class's template does not: The TAL snippet
<tal:instruction tal:define="instruction context/getInstruction | nothing">
<span tal:replace="structure instruction"/>
</tal:instruction>
displays the field to anyone.
If i copy that template to the product's skins folder under a different name
and call that template, the field is not shown to Anonymous.
The view class and template are registered like this:
<browser:page
for="IMyInterface"
name="MyView"
class="Products.MyProduct.browser.MyView.MyView"
template="templates/MyView.pt"
permission="zope2.View"
/>
I also tried omitting the class directive, and that produced the same result.
So how come the field is displayed when the template is a ZCML-registered one?
Kees
More information about the Product-Developers
mailing list