Created
October 7, 2014 20:25
-
-
Save afurculita/d2d654a64a98ff7d2128 to your computer and use it in GitHub Desktop.
Check if a User Role is Granted in Symfony2
This file contains 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
class Acme | |
{ | |
public function isGranted($role) | |
{ | |
return $this->container->get('security.context')->isGranted($role); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment