Give the gift of Drupal. All merchandise is 50% off through 2016.
The access manager got a new method which allows an access check given a route name and parameters.
Instead of using the path and generating a fake request, the route name and parameters should be used instead.
In addition, a path-based check depends on having the system path, so in the event you have only the aliased path, it would need to be processed by the inbound path processor.
$request = Request::create('/' . $href); $request->attributes->set('_system_path', $href); $request->attributes->add(Drupal::service('router.dynamic')->matchRequest($request)); return Drupal::service('access_manager')->check($route, $request);
Drupal::service('access_manager')->checkNamedRoute('user_admin_permission', array('role_id' => 'authenticated'));