On 08.12.2010, at 18:22, Jeremy Mikola wrote:

> Why does this token need to exist?  Wouldn't it be more useful to have a 
> security templating helper that can check for hasRole()?  Then you could do:
> 
> {% if _view.security.hasRole('foo') %}
> 
> ...directly in Twig; and it'd work fine with else and the Twig's boolean 
> operators (and, or, not).

thats a valid question. i also do not think we necessarily need a specific 
token for this.

speaking of the security helper: I opened a pull request to add a getUser() 
method:
https://github.com/fabpot/symfony/pull/223

and DoctrineUserBundle has a few other methods (though some of them need some 
fixing):
https://github.com/knplabs/DoctrineUserBundle/blob/symfony2Security/Templating/Helper/SecurityHelper.php

regards,
Lukas Kahwe Smith
m...@pooteeweet.org



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to