Protecting menu entries in Drupal 7

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!

Add new comment

Markdown

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Missing filter. All text is removed