RouteSubscriber.php in farmOS 2.x
File
modules/core/ui/views/src/Routing/RouteSubscriber.php
View source
<?php
namespace Drupal\farm_ui_views\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
class RouteSubscriber extends RouteSubscriberBase {
public function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('view.farm_log.page_asset')) {
$route
->setRequirement('_asset_logs_access', 'Drupal\\farm_ui_views\\Access\\FarmAssetLogViewsAccessCheck::access');
}
if ($route = $collection
->get('view.farm_asset.page_children')) {
$route
->setRequirement('_asset_children_access', 'Drupal\\farm_ui_views\\Access\\FarmAssetChildrenViewsAccessCheck::access');
}
if ($route = $collection
->get('view.farm_asset.page_location')) {
$route
->setRequirement('_location_assets_access', 'Drupal\\farm_ui_views\\Access\\FarmLocationAssetViewsAccessCheck::access');
}
if ($route = $collection
->get('view.farm_inventory.page_asset')) {
$route
->setRequirement('_asset_inventory_access', 'Drupal\\farm_ui_views\\Access\\FarmInventoryAssetViewsAccessCheck::access');
}
}
}