function BookAccess::_book_access_outline_access in Book access 1.x
Determines if the outline tab is accessible.
See also
File
- src/
Access/ BookAccess.php, line 760 - Allows to set the access control for book nodes on a per book basis.
Class
- BookAccess
- @file
Namespace
Drupal\book_access\AccessCode
function _book_access_outline_access($node) {
if (empty($node->book['bid'])) {
return FALSE;
}
//$view_access = node_access('view', $node);
if (\Drupal::currentUser()
->hasPermission('administer book outlines') && $view_access) {
return TRUE;
}
return BookAccess::checkGrant($node->book['bid'], 'edit_outline') && $view_access;
}