src/Provider/AbstractServiceProvider.php
protected function addAccessRule(Application $app, $pattern, $roles) {
        $security = $app['security.access_rules'];
        $key = is_object($pattern) ? spl_object_hash($pattern) : $pattern;
        $security[$key] = [
            $pattern,
            $roles
        ];

        $app['security.access_rules'] = $security;
    }
protected function addAccessRule(Application $app, $pattern, $roles) {
        $security = $app['security.access_rules'];
        $key = is_object($pattern) ? spl_object_hash($pattern) : $pattern;
        $security[$key] = [
            $pattern,
            $roles
        ];

        $app['security.access_rules'] = $security;
    }
protected function addAccessRule ( Application $ app , $ pattern , $ roles ) { $ security = $ app [ 'security.access_rules' ] ; $ key = is_object ( $ pattern ) ? spl_object_hash ( $ pattern ) : $ pattern ; $ security [ $ key ] = [ $ pattern , $ roles ] ; $ app [ 'security.access_rules' ] = $ security ; }
Add access rule to limit specific paths by role
@param Application $app
@param string $pattern
@param string|array $roles
Add access rule to limit specific paths by role