- Issue created by @jastraat
- Merge request !9Issue #3540845: Disable form fields in node form and remove from form state. β (Merged) created by jastraat
- πΊπΈUnited States jastraat
Note 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.
- πΊπΈUnited States cameron prince
10.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 onlyTest:
(+) 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.All tests pass.
(+) 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. - πΊπΈUnited States cameron prince
On D11 with tugboat, all tests pass as well. MR looks good.
Setting RTBC. -
jastraat β
committed db502acf on 1.0.x
Issue #3540845 by jastraat: Allow editors to see but not edit level-...
-
jastraat β
committed db502acf on 1.0.x