_node_add_access

6 node.module _node_add_access()
7 node.module _node_add_access()
8 node.module _node_add_access()

1 call to _node_add_access()

1 string reference to '_node_add_access'

File

modules/node/node.module, line 1883
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function _node_add_access() {
  $types = node_type_get_types();
  foreach ($types as $type) {
    if (node_hook($type->type, 'form') && node_access('create', $type->type)) {
      return TRUE;
    }
  }
  if (user_access('administer content types')) {
    // There are no content types defined that the user has permission to create,
    // but the user does have the permission to administer the content types, so
    // grant them access to the page anyway.
    return TRUE;
  }
  return FALSE;
}
Login or register to post comments