0

When I look into admin/people/permissions: 'View published content' is checked for anonymous users.

Yet the following code:

function test_menu() {
  $items['test'] = array(
    'title' => 'Test',
    'access arguments' => 'view published content',
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}

returns 'Accessed denied' when I navigate to /test as an anonymous user. I know I can do:

'access callback' => TRUE,

but the other code seems a lot neater. I've experienced this issue a few times before.

Thanks.

0

A quick look at node_permissions makes me think you should be using 'access content' as your argument, not view published content', as the latter is the proper machine name for the permission.

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.