You are here

public function UserLogout::processRoute in Services 8.4

Same name and namespace in other branches
  1. 9.0.x src/Plugin/ServiceDefinition/UserLogout.php \Drupal\services\Plugin\ServiceDefinition\UserLogout::processRoute()

Checks access for the ServiceDefintion.

Parameters

\Symfony\Component\Routing\Route $route: The route match object.

Overrides ServiceDefinitionBase::processRoute

File

src/Plugin/ServiceDefinition/UserLogout.php, line 31

Class

UserLogout
Plugin annotation @ServiceDefinition( id = "user_logout", methods = { "POST" }, title = @Translation("User logout"), description = @Translation("Allows users to logout."), category = @Translation("User"), path = "user/logout" )

Namespace

Drupal\services\Plugin\ServiceDefinition

Code

public function processRoute(Route $route) {
  $route
    ->setRequirement('_user_is_logged_in', 'TRUE');
}