A user can still edit all the original menu links and their translations. This appears to be because the menu listing page does not use an EntityListBuilder like other content entities. Instead the edit menu page is actually the entity form for menu entity: www/core/modules/menu_ui/src/MenuForm.php and the operations are just built in the form.

I suppose it would be possible to override it with hook_form_alter().

Comments

Rob230 created an issue. See original summary.

heddn’s picture

Status: Active » Needs review
StatusFileSize
new1.63 KB
heddn’s picture

StatusFileSize
new2.22 KB
new1.74 KB

I checked when we filtered out the locked languages. It was in the initial commit, without any details on why that was done. Given that menus can be tied to a variety of languages, I wonder if we can loosen that requirement and allow users to have permissions for all the things.

heddn’s picture

StatusFileSize
new6.58 KB
new4.77 KB

OK, a this point, this has a couple things related to language filtering that aren't strictly related to menus. I could split them out. But for now they are all very reviewable and it seems less complicated to keep them all in a single patch.

nterbogt’s picture

Status: Needs review » Needs work

The patch contains a regression in that the user form now allows 'Not specified' and 'Not applicable' to show on the user form as languages they can have access to. There are other cases in the code that specifically show these to all users, thus causing inconsistencies.

The patch also doesn't fix the /admin/structure/menu/manage/[menu] form for the edit/delete buttons of menu links. This one is less of an issue because while the buttons show, they show an access denied message when clicked to users without access to the language.

Generally a nice patch, but I feel there is overlap in how the content forms and menu forms restrict the language lists. We may be double handling now through a widget_language_select_form_alter and the element_info_alter.

heddn’s picture

With the opening of the 2.x branch, any suggestions on how to proceed here?

nterbogt’s picture

Hi!

I'm happy to look at this patch in the next week or so and rework it... unless you send me a change sooner than that :)

I'm pretty happy that permissions are applying correctly in 2.x for menus (try to edit a menu item for a language you don't have, you get access denied) but the same issues still appear (like showing the edit link on the menu form).

If you have the chance to install and test 2.x, I would appreciate it. Given the architecture is more modern, I'd like to continue on that branch if possible... and leave 1.x to bug fixes alone.