Protecting menu entries in Drupal 7

18 June, 2024

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!

Login or Register to Comment!