You are here

function book_copy_node_copy_access in Book Copy 7.2

Access check for ability to see Outline sub-tab on a node

1 string reference to 'book_copy_node_copy_access'
book_copy_menu in ./book_copy.module
Implements hook_menu().

File

./book_copy.module, line 84
Book copy, copy book outlines

Code

function book_copy_node_copy_access($node) {

  // test for not being in a book, no one can access this then
  if (!isset($node->book)) {
    return FALSE;
  }

  // test for root regardless of location
  if ($node->book['plid'] == 0 || arg(0) == 'admin') {

    // need ability to create new books, and add to books, and update this item, and copy books
    return user_access('create new books') && user_access('add content to books') && user_access('copy books');
  }

  // test for outline path when not root
  if (arg(0) == 'node') {

    // need ability to add to book, and update this item, and copy books
    return _book_outline_access($node) && user_access('add content to books') && user_access('copy books');
  }

  // this access routine only authorizes these two use-cases at the moment
  return FALSE;
}