You are here

function is_outline_access in Book made simple 6.3

1 call to is_outline_access()
book_made_simple_form_alter in ./book_made_simple.module
Implementation of hook_form_alter().
1 string reference to 'is_outline_access'
book_made_simple_menu in ./book_made_simple.module
Implementation of hook_menu().

File

./book_made_simple.module, line 68

Code

function is_outline_access($node = NULL) {
  if (user_access('administer books')) {
    return true;
  }
  if (isset($node->nid) && !(user_access('add content to books') || user_access('administer book outlines'))) {
    return false;
  }
  $bookTypes = variable_get('book_made_simple_auto_main_page', array());
  $bookType = array_key_exists($node->type, $bookTypes) ? $bookTypes[$node->type] : null;
  $access = true;
  if (null != $bookType && $bookType != "0" && $node->book['plid'] == 0) {
    $access = false;
  }
  return $access && user_access("show core Outline form element") && book_made_simple_creator_only_access($node);
}