вторник, 9 декабря 2014 г.

IS_AUTHENTICATED_REMEMBERED is not a role. It is a different kind of 
security attribute, handled by a different voter. However, has_role in 
security expressions only deals with roles. It replicates the work of 
the RoleVoter only. there is 2 ways to achieve your expectation here: 

- use the full authorization system to trigger all voters: 
@Security("is_granted('IS_AUTHENTICATED_REMEMBERED')") 
- use the dedicated function in the security language reproducing the 
same check: @Security('is_authenticated()'

The Symfony doc indeed describes all security attributes as roles, but 
this is a mistake in the doc. See 
https://github.com/symfony/symfony-docs/issues/4158 


From https://groups.google.com/forum/#!topic/symfony2/cyNRtjfrI8Q