The book modules allows for restricting the node types that are allowed for participating in the book hierarchy. The problem is that the Outline tab continues to appear even on nodes that are not enabled. A simple fix is to modify the _book_outline_access to look at the list of allowed types. The code should be:


function _book_outline_access($node) {
  return user_access('administer book outlines') && node_access('view', $node) && book_type_is_allowed($node->type);
}

Comments

avpaderno’s picture

Status: Active » Postponed (maintainer needs more info)

Would you be able to provide a patch?

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

The function works as expected, though. As reported in the book settings page (admin/content/book/settings):

Select content types which users with the add content to books permission will be allowed to add to the book hierarchy. Users with the administer book outlines permission can add all content types.

The difference between the users with permission to add content to books, and users with permission to administer book outlines is that the first users can add a node to a book when they edit or create a node (whose content type is selected in the book settings); the second users can add a node to a book by using the tab Outline, and they can add all the content types to books.

If you don't want a user is able to add every content type to a module, then don't give him the permission to administer book outline; as the permission contains the word administer, it should not be given to all the users.

I am changing the status of this report.