You are here

private function KernelEventListener::canRequestGetNode in Permissions by Term 8

Same name and namespace in other branches
  1. 8.2 src/Listener/KernelEventListener.php \Drupal\permissions_by_term\Listener\KernelEventListener::canRequestGetNode()
1 call to KernelEventListener::canRequestGetNode()
KernelEventListener::onKernelRequest in src/Listener/KernelEventListener.php
Access restriction on kernel request.

File

src/Listener/KernelEventListener.php, line 141

Class

KernelEventListener
Class KernelEventListener.

Namespace

Drupal\permissions_by_term\Listener

Code

private function canRequestGetNode(Request $request) {
  if (method_exists($request->attributes, 'get') && !empty($request->attributes
    ->get('node'))) {
    if (method_exists($request->attributes
      ->get('node'), 'get')) {
      return TRUE;
    }
  }
  return FALSE;
}