Posted by kevinquillen on March 1, 2011 at 3:55pm
6 followers
| Project: | Menu attributes |
| Version: | 6.x-2.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Issue Summary
Is it possible to have permissions added to have access to menu attributes?
Comments
#1
#2
I am also looking for this feature.
#3
I'm wondering what the use case is. Pretty much we only alter existing UIs that already require the 'administer menus' permission either on the node form or the menu settings.
#4
Separation. For some users, it makes sense that they can add menu items and administrate menus (the links and structure) without seeing the extended attribute forms. For example, having an administrator, and simply having a content manager role. The content manager can still create menu items, or extraneous menu items (via Menu administration) but not necessarily need to see/edit menu attributes.
Maybe I am misunderstanding- but don't you need 'administer menus' to get to the menu links page to add links?
#5
Anyone with the 'administer menus' can do *anything* with menus and menu links, so I still don't see why we need to have a separate permission for menu attributes.
#6
I guess what I am saying is, if you don't have 'administer menus' permission, you can't add menu links from the admin. This is often necessary for navigation links that are not a node (usually ones that go off-site, or aliases of internal links for SEO). This is a great module for a themer, but confusing for end-user (a client) who sees the additional fields but won't use them.
Example:
UID 1 / developer / site administrators - have administer menus permission, can add/change menu attributes for theming or SEO
lower roles / content editors - have administer menus permission, but does not need to see/use anything about menu attributes
'administer menus' permission is important for both roles to create additional links from the menu administration.
#7
+1
Some things are only useful for administrators and confuse the end-user. I've been working on a project to simplify Drupal administration, and it's a lot of work where granularity of permissions is very important.
#8
Here is a patch I made to accomplish this. Might need to clear your cache, since hook_menu was changed.
It adds a 'administer menu attributes' permission, and with it, it will add attributes to forms that have menus attached.
#9
Noticed a typo in the hook_perm in previous patch. Resubmitting
#10
I agree with #7 because I was also confronted with this issue, clients asking about some options that they'll never have to use. I had to alter some forms to hide those advanced options so I can surely see why this would be a good feature.
Patches attached for 6.x-1.x (see http://drupal.org/node/1241828#comment-4833998) and 7.x-2.x.
#11
This is adding access to the wrong places.
function _menu_attributes_form_alter() should be using the following: rather than having user_access() called in all of its callers:
$form['options']['attributes']['#access'] = user_access('administer menu attributes');
menu_attributes_form_menu_configure_alter() should just return rather than wrap its stuff in user_access() - less indentation makes the code easier to read and there's no reason for that function to continue if the user does not have the permission.
Also, we need to consider an upgrade path adding the permission to any role with the 'administer menu' permission since this would result in a loss of UI.
#12
Nice! It's great to learn best practices like this :)
New patch for 7.x. If you are ok with it, I'll roll one for 6.x as well.
#13
The last submitted patch, 1077426-menu_attributes_permission-12.patch, failed testing.
#14
#12: 1077426-menu_attributes_permission-12.patch queued for re-testing.
#15
Commited #12 without the 'Implements hook_update_N()' doxygen to 7.x-1.x.
http://drupalcode.org/project/menu_attributes.git/commit/4dbf8c2
#16