It would be great if Menu Link Weight could be used with Menu Admin Per Menu.
From the project page for Menu Admin Per Menu:
By default, Drupal allows only users with the Administer menus and menu items permission to add, modify or delete menu items.
Menu Admin per Menu allows to give roles per menu admin permissions without giving them full admin permission.
For instance, you may let certain users manage the items of the Main or Navigation menus but not those of the Management menu.
When using Menu Admin Per Menu, roles that may add/edit/delete menu items in particular menus will have a permission per menu instead of the standard "administer menu" permission.
This means that most of the users with permissions from Menu Admin Per Menu cannot use the nice draggable interface provided by Menu Link Weight since Menu Link Weight is checking for users to have the permission "administer menu".
From menu_link_weight.module:
function menu_link_weight_form_node_form_alter(&$form, &$form_state) {
if (!user_access('administer menu') || !isset($form['menu']['link'])) {
// Only allow users with "administer menu" permissions.
return;
}
...
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2617614-5.patch | 959 bytes | stefan.r |
| #4 | interdiff-2617614-2-4.txt | 1.04 KB | genjohnson |
| #4 | 2617614-4.patch | 884 bytes | genjohnson |
| #2 | 2617614-2.patch | 843 bytes | stefan.r |
Comments
Comment #2
stefan.r commentedComment #3
stefan.r commented@genjohnson can you please test and review this patch - if all looks well I will commit it.
Comment #4
genjohnson commented@stefan.r wow, thank you for such a quick response!
The patch in #2 applied cleanly. I tested with a user who had the 'administer menus' permission and a user who only had permission to administer the Main Menu (through Menu Admin Per Menu) and everything worked just fine.
A couple of suggestions...
Attached is a patch and interdiff with these suggestions.
Comment #5
stefan.r commentedThanks!
1 is the same check as in menu_admin_per_menu_node_form_alter so I believe we should keep this stricter check, just in case.
For 2 the worry would be for that helper function to disappear in a future version which could give a fatal error and the function_exists is not expensive so we can keep that as well. I'll commit this with the updated comment.
Comment #7
stefan.r commentedComment #8
stefan.r commented