Drupal 7: Menu item being accessed even with false access callback? I have a menu item:

$items['login-now'] = array
(
    'title' =&gt; 'Log In',
    'page callback' =&gt; 'some_or_other_method',
    'access callback' =&gt; 'the_permissions_function',
    'menu_name' =&gt; 'menu-ecommerce-nav',
    'type' =&gt; MENU_NORMAL_ITEM,
    'weight' =&gt; '5',
);


And then I have:

function the_permissions_function { 
    $isAnonymousUser = user_is_anonymous();
    if (!$isAnonymousUser) {
        return FALSE;
    } 
    return TRUE;
}


This works if I am logged out. I can see the "log in" button. But when I log in, it STILL shows this login button. Why?

What's interesting is, I added this above the "return false"

print 'xxxx'; die();


And it hits this code!! But for some reason, it still shows the menu item? Why is it not hiding the menu item?

UPDATE

Even if I just do this:

'access callback' =&gt; 'user_is_anonymous',


It STILL shows the "log in" menu item when I am LOGGED in. Why on earth is it doing this? What am I missing?
user_is_anonymous() returns TRUE if the user is a menu administrator: see function user_is_anonymous

Try user_is_logged_in() instead, e.g.:

function the_permissions_function { 
    $isLoggedIn = user_is_logged_in();
    if ($isLoggedIn) {
        return FALSE;
    } 
    return TRUE;
}