-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joachim Schmitz wrote:
> in an pt I have:
> 
> <metal:block fill-slot="main"
>                tal:define="folder here/getContent;
>                items here/contentValues;
>                ">
> <span tal:repeat="item items">
> <a href="xxx"  tal:attributes="href item/absolute_url"
>                tal:content="item/title_or_id"></a>
> </span>
> 
> </metal:block>
> 
> this displays the url for all items, even those which are not accessible
> by the user. 

That's Zope behavior.

> If he clicks on the url, he is asked for login. How can I
> test in the pt, if that item is accessible by the user, so that the link
> is not displayed at all.
> 

You may use the checkPerm utility defined within the main_template.pt:

<tal:block condition="checkPerm('View', item)>
  <!-- display the item URL -->
</tal:block>

Note, that checkPerm is an alias for portal_membership.checkPermission()

Cheers,

        J.
- --
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM   : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDbN6mGhoG8MxZ/pIRAmXgAJ4oF7q8NmfgKn0BguHm0NCqJrjqSACfRxEP
XX6XT2vimMUlmOlgROFthbM=
=Hz18
-----END PGP SIGNATURE-----
_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to