You are here

public function AccessCheck::handleNode in Permissions by Term 8.2

Same name and namespace in other branches
  1. 8 src/Service/AccessCheck.php \Drupal\permissions_by_term\Service\AccessCheck::handleNode()

File

src/Service/AccessCheck.php, line 217

Class

AccessCheck
AccessCheckService class.

Namespace

Drupal\permissions_by_term\Service

Code

public function handleNode(Node $node, string $langcode) : AccessResult {
  $result = AccessResult::neutral();
  if (!$this
    ->canUserAccessByNode($node, false, $langcode)) {
    $this
      ->dispatchDeniedEvent($node
      ->id());
    $result = AccessResult::forbidden();
  }
  return $result;
}