In a custom module, if you have a menu hook item that has a custom access argument, but don't specify an access callback, what is drupal's default behavior? Does it use user_access? In other words, is an access callback necessary to specify?

2 Answers 2


Yes it uses user_access() by default, but only when you specify 'access arguments'. See http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_menu/7.


Drupal will use user_access() as default value for the access callback, if the menu item doesn't inherit the value for the access callback from the parent menu item, and you define the access arguments.

This is an example of menu item that inherits the access callback from the parent menu (the menu items are defined in node_menu()):

  $items['admin/content'] = array(
    'title' => 'Content', 
    'description' => 'Find and manage content.', 
    'page callback' => 'drupal_get_form', 
    'page arguments' => array('node_admin_content'), 
    'access arguments' => array('access content overview'), 
    'weight' => -10, 
    'file' => 'node.admin.inc',
  $items['admin/content/node'] = array(
    'title' => 'Content', 
    'weight' => -10,

The second menu item doesn't define neither the access callback nor the access arguments, but they are inherited from the parent menu item.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.