When blocking access to a page -- its child links get skipped both in code and display.

The block is achieved via an access callback attached to the menu item that checks whether the user is logged in or not.

The desired behavior is to show the links regardless of the login status.

Any hints?

P.S. I'm using drupal6

  • Hello, and welcome to Drupal Answers. How are those links generated? Are links added from a module with hook_menu(), or are links you added through the user interface (a.k.a. the administrative page that adds links to Drupal)? – kiamlaluno Jan 7 '13 at 14:05

With the caveat you should be very careful adjusting any core menu item permissions, and I'm presuming you know what you're doing there, it is possible to adjust any menu with


for example:

function mymodule_menu_alter(&$items) {
  // Enable open access for everyone to foo/bar
  $items['foo/bar']['access callback'] = TRUE;

You can also specify your own access callback there, e.g

function mymodule_menu_alter(&$items) {
  // Add custom access callback to foo/bar
  $items['foo/bar']['access callback'] = 'mymodule_special_access';

function mymodule_special_access(){
  global $user;
    return TRUE;
  return FALSE; // default deny
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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