Last active
March 22, 2016 19:38
-
-
Save jenkoian/bf5ff2c80179b0583285 to your computer and use it in GitHub Desktop.
Custom request matcher compiler pass
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
<?php | |
//... | |
use ...CallableCompilerPass; | |
//... | |
protected function configurePasses(ContainerBuilder $c) | |
{ | |
$c->addCompilerPass(new CallableCompilerPass(function (ContainerBuilder $c) { | |
if (!$c->hasDefinition(‘security.access_map’)) { | |
return; | |
} | |
$accessMapDefinition = $c->getDefinition(‘security.access_map’); | |
$accessMapDefinition->addMethodCall(‘add’, [new Reference(‘app.permission_url_request_matcher’)]); | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jenkoian in
new Reference(‘pp.permission_url_request_matcher’)
there is probably a typo. Maybe you meant:new Reference(‘app.permission_url_request_matcher’)