My company recently wanted to use admin_menu on a client site, but we also wanted to be able to have the module load custom menus depending on the user role. So I hacked admin_menu to do just that, and it seems like it might be a worthwhile addition to the next release of the module.
This patch adds a few extra controls to the admin_menu configuration form. You can choose which roles (out of the ones with the "access administration menu" permission) get to see which menu, and assign weights to each rule to account for users with more than one role. The super-administrator (user 1) always gets the full admin_menu, regardless of role.
Apply the patch from the main modules directory, like so:
cd sites/default/modules (or wherever your modules directory is)
patch -p0 < admin_menu.inc.patch
patch -p0 < admin_menu.module.patch
This patch is for Drupal 6.x only!
| Comment | File | Size | Author |
|---|---|---|---|
| admin_menu.module.patch | 998 bytes | phenaproxima | |
| admin_menu.inc_.patch | 2.06 KB | phenaproxima |
Comments
Comment #1
sunYour coding-style needs work. Please read http://drupal.org/coding-standards carefully. Additionally, please do not use tabs (2 spaces instead), and place inline comments above the remarked line (not behind it).
Also, could use please elaborate a bit more on what this patch does, your concrete use-case, and why you implemented it that way?
Comment #2
philingle commentedI think that this is a great idea. I only have 6.x-3.0-alpha3 on my dev sites at the minute so cant test it out but I second the idea of adding this feature to the admin menu.
I currently create individual admin menu's for my users but have to put them in blocks on the site somewhere, it would be far better if they could have their own custom admin menu.
Comment #3
klonos+1
...subscribing.
Comment #4
sunComment #5
klonosHope to see this in D6 as well once done with D7.
Comment #6
mattgilbert commentedsubscribing
I also would like to see this with Drupal 6.
Comment #7
manoloka commentedsubscribe
Comment #8
nancydruDon't know what happened to the OP.
@Sun: My use case: We have several different departments using the site. The Communications department "owns" it and does most of the maintenance (IT does the rest). There are, however, other departments who create content. Some departments can create some types of content, others other types. Communications may create or alters users; one department has to maintain a sidebar block. There are many combinations of permissions, as on many sites. While a standard menu block would handle this, different pages have different block placements. For us, the best place for an administrative menu is at the top, as this module does.
The site is still on 6.x because most of the needed modules are not ready for D7.
Why is there a 7.x branch when this is in core?
Comment #9
jeff.maes commentedIf you don't need the settings in the back-end, you could do something like this in your own module:
I think it's cleaner than patching the module.
Tested and working with the 7.x-3.x-dev version of 2011-May-06
Comment #10
travelerttWhy not have Admin Menu work the same way as the Toolbar in D7. Where Menu Items appear in the menu according to the permissions of the user? This could be the default functionality of the menu. Honestly, as someone new to Drupal, this is what I expected Administration menu to do.
I was surprised to find out that after I had set my site up, that my site Editors (role) were unable to see any menu items, and my site Editors(role) the other case had access to more menu options than their permissions allowed. Now I'm not implying that I enabled this Module for all users, just users that I had granted limited rights to moderate and edit my site.
Comment #11
sunComment #12
sunFWIW: http://drupal.org/project/admin_menu_source
This link does not mean that I recommend to use that module. In fact, the module's implementation can easily blow up.
Comment #13
truls1502I am sorry for no reply until now.
There are many issues regarding this module admin_menu which is a bit difficult for us to follow up since some of the issues might be already outdated, or is already fixed by the module or any other modules or itself core which means that the problem might no longer need to be fixed.
We can see that the issue has been created for a few years ago, I hope it is okay for you that I am postponing the issue, and give you around two weeks. If you still face the problem, could you tell us the step by step when until you get the error message or what is frustrated you, and a list of modules you are using related to admin_menu and a screenshot that might help us? So it makes us easier to reproduce your issue.
However, after two weeks with no feedback - we will close this issue. So in case, you noticed it after the issue is closed, do not hesitate to reopen it like and fill information which is mentioned above.
So before giving us a feedback, do you mind to test it again with our latest 7.x-3.x-dev?
Thank you for understanding! :)
Comment #14
truls1502This issue has been automatically marked as closed because it has not had recent activity after the last post.
However, if you or someone is still facing the same issue as described to the issue, could you please to re-open the issue by changing the status of the issue, and add an explanation with more details which can help us to reproduce your situation.
Again, thank you for your contributions! :)