collectNodeLinks example


  public function checkNodeAccess(array $tree) {
    $node_links = [];
    $this->collectNodeLinks($tree$node_links);
    if ($node_links) {
      $nids = array_keys($node_links);

      $query = $this->entityTypeManager->getStorage('node')->getQuery();
      $query->accessCheck(TRUE);
      $query->condition('nid', $nids, 'IN');

      // Allows admins to view all nodes, by both disabling node_access       // query rewrite as well as not checking for the node status. The       // 'view own unpublished nodes' permission is ignored to not require cache       // entries per user.
Home | Imprint | This part of the site doesn't use cookies.