Skip to content

Instantly share code, notes, and snippets.

@afurculita
Created October 7, 2014 20:25
Show Gist options
  • Save afurculita/d2d654a64a98ff7d2128 to your computer and use it in GitHub Desktop.
Save afurculita/d2d654a64a98ff7d2128 to your computer and use it in GitHub Desktop.
Check if a User Role is Granted in Symfony2
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