Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Menu Per Role

13,645 sites Security covered Drupal 11 · not 10
View on drupal.org

This module allows you to hide menu items from users based on their assigned roles, without affecting access to the destination pages themselves. It's useful for cases involving external links or when you want to control menu visibility independently of content access.

This module allows you to restrict access to menu items based on user roles. Just activate the module and edit a menu item as usual. There will be a new fieldset that allows you to restrict access by role.

We wrote "menu items", not "nodes". This module does not prevent users from accessing the destination nodes. It only changes the visibility of the menu items.

Do I need this module?

Short answer

It is very likely that you do not need this module at all.

Log In, Log Out, Register & My Account

When you want to create a "Log In" menu item, in any menu, make it point to "user/login". That way it will disappear once a user is logged in. You probably know about the "Log Out" path, it is shown in the Navigation menu: "logout". To offer a Register menu item to anonymous users, make the link point to "user/register". And if you want to show a "My Account" link, use "user". That will always be visible and if an anonymous user tries that link, he will first be asked to log in.

  • Log In, user/login
  • Log Out, logout
  • Register, user/register
  • My Account, user
Consider the destination node access instead

You may want to use modules that control node access rights. In Drupal a menu link that points to a page that cannot be accessed by the current user is not shown to that user. That's much simpler than having to edit each menu item for specific role permissions!

If you need finer control over node access rights, have a look at:

  1. content access (Read node 220680, comment 1084593)
  2. taxonomy_access
  3. forum_access
  4. config_perms
So?! What is this module for???

Now... There are a few cases when hiding a menu item by role can still be useful. Although rare, it happens.

  • You are dealing with external links (these are considered public and have full access rights by default.)
  • Menus that you do not want to show to certain users although the destination pages are still freely accessible.

For example, you could have a site with a menu for registered users and a menu used to appeal to new users so they create an account:

  • My Account
    • Edit my info
    • Send a message to my friends
    • Log Out
  • New to This Website?
    • Check out why you should register
    • Still not convince? Check our video!
    • Register Now
    • Already have an account? Log In now!

The "My Account" menu should probably not appear when your users are not yet logged in. Install menu_per_role, edit the "My Account" menu item, and select all the roles except "anonymous". Note that this case can also be solved by changing the access rights of the node pointed to by "My Account" menu item.

The "New to This Website" menu should definitively be removed once the person is logged in. Install menu_per_role, edit the "New to This Website" menu item, and mark it for the "anonymous" role. This way, the reasons why this site is worth the trouble are still accessible to the logged in users, just not directly accessible through the menu.

Requirements

There is no special requirement for this module.

Limitation

For Drupal 8+, Menu Per Role only acts on content menu link (content entity). Menu links provided by configuration (example: Views) or by *.links.menu.yml files can't be managed by this module.

  • Menu Admin per Menu: By default, Drupal allows only users with "administrer menu permission" to add, modify or delete menu items. In case you want for instance to let certain users manage primary links or secondary links but not navigation menu, this module provides this functionality.
  • Menu item visibility: Does the same thing as Menu Per Role.

Maintainers

Current maintainers:

Previous maintainers:

This project has been sponsored by:

Depends on

Dependencies of the latest stable release

  • menu_link_content Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Dec 2025
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.0.0 Stable 11 Jul 19, 2026
8.x-1.9 Stable 10–11 Jul 19, 2026
2.x-dev Dev 11 Dec 5, 2025