class DisableThemeCsrfRouteSubscriber in Automatic Updates 8
Disable theme CSRF route subscriber.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\test_automatic_updates\EventSubscriber\DisableThemeCsrfRouteSubscriber
Expanded class hierarchy of DisableThemeCsrfRouteSubscriber
1 string reference to 'DisableThemeCsrfRouteSubscriber'
- test_automatic_updates.services.yml in tests/
modules/ test_automatic_updates/ test_automatic_updates.services.yml - tests/modules/test_automatic_updates/test_automatic_updates.services.yml
1 service uses DisableThemeCsrfRouteSubscriber
- test_automatic_updates.route_subscriber in tests/
modules/ test_automatic_updates/ test_automatic_updates.services.yml - Drupal\test_automatic_updates\EventSubscriber\DisableThemeCsrfRouteSubscriber
File
- tests/
modules/ test_automatic_updates/ src/ EventSubscriber/ DisableThemeCsrfRouteSubscriber.php, line 11
Namespace
Drupal\test_automatic_updates\EventSubscriberView source
class DisableThemeCsrfRouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
// Disable CSRF so we can easily enable themes in tests.
if ($route = $collection
->get('system.theme_set_default')) {
$route
->setRequirements([
'_permission' => 'administer themes',
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DisableThemeCsrfRouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. 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 |