private function RouteSubscriber::removePermissionRequirement in Block Content Permissions 8
Remove required "administer blocks" permission from route.
Parameters
\Symfony\Component\Routing\Route $route: The Route object.
1 call to RouteSubscriber::removePermissionRequirement()
- RouteSubscriber::alterRoutes in src/
Routing/ RouteSubscriber.php - Alters existing routes for a specific collection.
File
- src/
Routing/ RouteSubscriber.php, line 72
Class
- RouteSubscriber
- Listens to the dynamic route events.
Namespace
Drupal\block_content_permissions\RoutingCode
private function removePermissionRequirement(Route $route) {
if ($route
->hasRequirement('_permission')) {
$requirements = $route
->getRequirements();
unset($requirements['_permission']);
$route
->setRequirements($requirements);
}
}