I use FOSUserBundle in my project. I have a Controller AcmeArticleBundle:Edit
which has a route prefix /editor
. And in my security.yml I added an access control.
access_control:
- { path: ^/editor/, role: ROLE_EDITOR }
Now I add ROLE_EDITOR
to a user in a controller. But user cannot access AcmeArticleBundle:Edit
and security context does not change until logging out and logging in again.