Protecting menu entries in Drupal 7

Authorized Personnel sign

Sometimes you want to add menu items that can only be accessed if the user is logged in. With Drupal 6, the menu_per_role module is the way to go. That module, however, is not available for D7, at the time of this writing. So, what to do?

If the availability is simply a matter of the user being authenticated, you can add the menu item to the User menu. This menu is only available to authenticated users. If the availability is more granular than simply an authenticated user, such as a specific role, you can create a new menu, assign the menu items to it, and specify that the block that lists the menu only be available to the role(s) you wish!

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.
Design by Ayen Designs. Underlying Drupal theme by Kiwi Themes.