Update Composer, update everything

This commit is contained in:
Oliver Davies 2018-11-23 12:29:20 +00:00
parent ea3e94409f
commit dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions

View file

@ -0,0 +1,39 @@
<?php
namespace Drupal\{{ machine_name }}\EventSubscriber;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\Routing\RouteCollection;
/**
* {{ name }} route subscriber.
*/
class {{ class }} extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
foreach ($collection->all() as $route) {
// Hide taxonomy pages from unprivileged users.
if (strpos($route->getPath(), '/taxonomy/term') === 0) {
$route->setRequirement('_role', 'administrator');
}
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events = parent::getSubscribedEvents();
// Use a lower priority than \Drupal\views\EventSubscriber\RouteSubscriber
// to ensure the requirement will be added to its routes.
$events[RoutingEvents::ALTER] = ['onAlterRoutes', -300];
return $events;
}
}