Symfony 2: Get Security Context Outside of Controller

ahoroscopuse1

New Member
I am trying to write an event listener that needs access to the users permission level. In the controller I use the following codeCode:\[code\]$securityContext = $this->container->get('security.context');if($securityContext->isGranted('ROLE_USER')){ //Do Something}\[/code\]But outside of a controller I can't work out how to get the security context. Is it possible?
 
Top