-1

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

Ricardo
  • 11,609
  • 8
  • 27
  • 39
  • I dont get these downvotes without comments! Im I stupid? Ok, prove it. – Ricardo Jul 23 '14 at 14:54
  • possible duplicate of [Symfony2 get to the access\_control parameters located in the security.yml](http://stackoverflow.com/questions/19831114/symfony2-get-to-the-access-control-parameters-located-in-the-security-yml) – Ricardo Jul 23 '14 at 14:58

1 Answers1

0

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'];
Community
  • 1
  • 1
Ricardo
  • 11,609
  • 8
  • 27
  • 39