On Tuesday February 3, 2009 18:21:39 Gustavo Narea wrote:
> >>> from repoze.what.predicates import has_permission
> >>> p = has_permission('edit-posts')
> >>> p.is_met(environ)
> True
With TG 2.0b6, the following will be equivalent:
>>> from repoze.what.predicates import has_permission
>>> from tg.some-namespace-which-i-dont-know-yet import evaluate
>>> evaluate(has_permission('edit-posts'))
True
Or the way you want to use it in your templates:
<p py:if="evaluate(has_permission('edit-posts'))">
Congrats! You can edit blog posts.
</p>
Cheers.
--
Gustavo Narea <http://gustavonarea.net/>.
Get rid of unethical constraints! Get freedomware:
http://www.getgnulinux.org/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---