public function Redirect::checkForRedirection in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.2 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.3 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.4 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.5 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.6 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.7 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 8.8 modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
- 10.0.x modules/custom/social_gdpr/src/Subscriber/Redirect.php \Drupal\social_gdpr\Subscriber\Redirect::checkForRedirection()
This method is called when the KernelEvents::REQUEST event is dispatched.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The event.
File
- modules/
custom/ social_gdpr/ src/ Subscriber/ Redirect.php, line 61
Class
- Redirect
- Class Redirect.
Namespace
Drupal\social_gdpr\SubscriberCode
public function checkForRedirection(GetResponseEvent $event) {
if ($this->routeMatch
->getRouteName() != 'entity.data_policy.version_history') {
return;
}
if ($this->currentUser
->id() == 1 || !$this->currentUser
->hasPermission('view all data policy revisions')) {
return;
}
$url = Url::fromRoute('social_gdpr.data_policy.revisions');
$response = new RedirectResponse($url
->toString());
$event
->setResponse($response);
}