I have my access_control defined in security.ylm. Is it possible to get the current page roles in my code (without parsing the ylm file 'by hand') ?
Thanks
I have my access_control defined in security.ylm. Is it possible to get the current page roles in my code (without parsing the ylm file 'by hand') ?
Thanks
Its duplicate of : Symfony2 get to the access_control parameters located in the security.yml
use Symfony\Component\Yaml\Yaml;
$file = sprintf("%s/config/security.yml", $this->container->getParameter('kernel.root_dir'));
$parsed = Yaml::parse(file_get_contents($file));
$access = $parsed['security']['access_control'];