class RouteSubscriber in Taxonomy access fix 8
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\taxonomy_access_fix\Routing\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
1 string reference to 'RouteSubscriber'
1 service uses RouteSubscriber
File
- src/
Routing/ RouteSubscriber.php, line 8
Namespace
Drupal\taxonomy_access_fix\RoutingView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* New and improved hook_menu_alter().
*/
public function alterRoutes(RouteCollection $collection) {
// admin/structure/taxonomy
if ($route = $collection
->get('entity.taxonomy_vocabulary.collection')) {
$route
->setRequirements([
'_custom_access' => '\\taxonomy_access_fix_route_access',
]);
$route
->setOption('op', 'index');
}
// admin/structure/taxonomy/%vocabulary
if ($route = $collection
->get('entity.taxonomy_vocabulary.overview_form')) {
$route
->setRequirements([
'_custom_access' => '\\taxonomy_access_fix_route_access',
]);
$route
->setOption('op', 'list terms');
}
// admin/structure/taxonomy/%vocabulary/add
if ($route = $collection
->get('entity.taxonomy_term.add_form')) {
$route
->setRequirements([
'_custom_access' => '\\taxonomy_access_fix_route_access',
]);
$route
->setOption('op', 'add terms');
}
// admin/structure/taxonomy/manage/%vocabulary/reset
if ($route = $collection
->get('entity.taxonomy_vocabulary.reset_form')) {
$route
->setRequirements([
'_custom_access' => '\\taxonomy_access_fix_route_access',
]);
$route
->setOption('op', 'reorder terms');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
public | function |
New and improved hook_menu_alter(). Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |