Created
March 5, 2012 16:44
-
-
Save marcoleong/1979204 to your computer and use it in GitHub Desktop.
symfony2 authentication user, use this in controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//... | |
if(!$this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')){ | |
throw new AccessDeniedException(); | |
} | |
//... | |
$user = $this->get('security.context')->getToken()->getUser(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment