0
votes

I am using a drupal 6. I need to restrict access to certain pages to my site for only the authenticated users. All these pages are having their own primary navigation parent menu, mouse hover on which it shows the sub menu to these pages. Once user clicks on it, it should show the page content if user is authenticated otherwise should show "Access Denied".

I tried to use Content Access module, though it restricts the access to the pages but it does not even show the menu link to anonymous user in menu list.

Is it possible to show menu in menu list, but on clicking on link it should show the access denied message of user is anonymous?

1
If you don't find a sufficient answer here, try the Drupal Answers, the drupal specific SE - Sam DeHaan

1 Answers

2
votes

There are 2 ways you can go about this, the field permissions module if you just want to limit to specific fields or you can make a PHP block, call global $user within it, and if the user's role doesn't match on the node type for who you need to be, then call drupal_access_denied()

http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_access_denied/6

The block method is going to be much more efficient because you won't have to configure a billion checkboxes if you have a lot of fields and because if you make the block within a custom module, it will be exportable easily to other Drupal sites.