Closed (fixed)
Project:
Menu Level Permissions
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2025 at 20:09 UTC
Updated:
3 Sep 2025 at 14:54 UTC
Jump to comment: Most recent
Comments
Comment #3
jastraat commentedNote that this will only work in Drupal 10. In Drupal 11, Drupal returns AccessResultForbidden for the menu element within the node form based on the access of the existing associated menu link content item. This means that the menu section is fully removed already from the node form.
Comment #4
jastraat commentedComment #5
jastraat commentedComment #6
cameron prince commented10.5.2 Testing
Setup:
(+) Need two roles with admin level permissions + page editing permissions (e.g. admin and content_editor)
(+) admin role needs the "administer restricted menu levels" permission and content_editor should not have this.
(+) create a user with the content_editor role
(+) On /admin/config/user-interface/menu-level-permissions restrict the main navigation menu and select level one only
Test:
(+) Admin can add/edit/delete all menu links in node forms at level 1 or level 2.
(+) Editor can add links at level 2.
(+) Editor cannot add links at level 1.
(+) Editor can edit and remove existing links at level 2.
(+) If an editor edits a node with an existing level 1 link, they either see the fields as disabled in the node form (Drupal 10) or see a message indicating that they don't have access to edit the menu because of level (Drupal 11).
(+) An editor can edit a node with an existing level 1 link and save without any impact to the existing menu item.
All tests pass.
Comment #7
cameron prince commentedOn D11 with tugboat, all tests pass as well. MR looks good.
Setting RTBC.
Comment #9
jastraat commentedThank you! Merged -
Comment #10
jastraat commented