You are here

function book_access_node_view in Book access 1.x

Same name and namespace in other branches
  1. 7.2 book_access.module \book_access_node_view()

Implements hook_node_view().

We want to hide the "Add Child Page" link if the current user doesn't have permission for it.

File

./book_access.module, line 419

Code

function book_access_node_view(array &$build, NodeInterface $node, $view_mode, $langcode) {

  /*  if (isset($node->content['links']['book'])
    && isset($node->content['links']['book']['#links']['book_add_child'])) {

    if (! BookAccess::checkGrant($node->book['bid'], 'grant_add_child')) {
    unset($node->content['links']['book']['#links']['book_add_child']);
    }
    }*/
}