Drupal - how to register a MENU_CALLBACK that is accessable to all users(even anonymous ones)?
Posted
by rubayeet
on Stack Overflow
See other posts from Stack Overflow
or by rubayeet
Published on 2010-04-29T05:25:56Z
Indexed on
2010/04/29
5:47 UTC
Read the original article
Hit count: 317
I'm trying to learn Drupal 6. I want to register the path '/topic' to a MENU_CALLBACK using hook_menu(). Here's what I have:
function mymodule_menu() {
$items = array()
$items['foo'] = array(
'page callback' => 'show_page_foo',
'access callback' => 'user_access',
'access arguements' => array('access foo content'),
'type' => MENU_CALLBACK
);
}
function show_page_foo() {
//show foo page
}
This works fine for a logged in user. But when I visit the path as an anonymous user it shows 'Access Denied' message. What must be the 'access callback' and 'access arguments' values to have this accessible to all visitors?
I remember I made this work by simply saying 'access' => TRUE
in Drupal 5. No longer works in Drupal 6.
© Stack Overflow or respective owner