Add separate Create, Edit, and Delete Permissions for Menu Items per Menu

Created on 28 February 2025, 9 days ago

Problem/Motivation

Currently, Drupal's menu system does not provide granular permissions for managing menu items within a specific menu. Users with the "Administer menus and menu items" permission can create, edit, and delete any menu item, but there is no way to restrict these actions separately.

For example, in Taxonomy, we can define separate Create, Edit, and Delete permissions per vocabulary (e.g., "Tags: Create terms", "Tags: Edit terms", "Tags: Delete terms"). A similar approach for menus would provide better control over user roles and content management workflows.

Current workaround
Some contributed modules, like Simple Menu Permissions , attempt to solve this problem by offering more granular menu permissions. However, this functionality should ideally be available in Drupal Core to provide a consistent and reliable solution without requiring third-party modules.

Steps to reproduce

  1. Navigate to People > Permissions.
  2. Look for the menu-related permissions under Menu module.
  3. Notice that there is a single "Administer menus and menu items" permission that applies to all actions (Create, Edit, and Delete).

Proposed resolution

Introduce separate Create, Edit, and Delete permissions for menu items per menu, similar to taxonomy term permissions per vocabulary. This would allow:

  • Granting users the ability to create menu items but not edit or delete existing ones.
  • Restricting deletion of menu items to specific user roles.
  • Allowing finer control of menu item management on a per-menu basis.

Remaining tasks

  • Define how the new permissions should be structured.
  • Update the Menu module to implement these permissions.
  • Provide a UI for assigning these permissions in the Permissions page.
  • Write automated tests to verify correct permission behavior.
  • Update documentation.

User interface changes

The Permissions page (admin/people/permissions) will have new entries under the Menu module:
"Create menu items in [Menu Name]"
"Edit menu items in [Menu Name]"
"Delete menu items in [Menu Name]"

Introduced terminology

No new terminology introduced; just extended permission granularity for menu items.

API changes

New permission keys in the permissions system for menus.
Possible updates to menu-related APIs to check for specific permissions instead of a single "administer" permission.

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.1 🔥

Component

menu system

Created by

🇮🇳India prashant.c Dharamshala

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024