Problems with users with multiple roles
| Project: | RootCandy |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | sign |
| Status: | closed |
Hi my friend, there is a problem in the latest version (RC3) with users having assigned more than one role. At line #46 of template.php you are getting (why?) the last element of the roles array:
$role = end(array_keys($user->roles));in order to get the custom icons, but if the user has several roles (pretty common) the last one is not necesarily the one I've selected in the RootCandy admin. Perhaps you need to transverse the array instead.
Also, in the previous line you modified now the usage of the #1 user:
if ($user->uid != 1) {....so I turned crazy the whole day trying to guess why my pre-RC-3 working menu didn't now :), I don't get why you're excluding the "super user" from the game, is just a regular user, able to have assigned roles, etc.
Let me know if can help you to work out this issue, I can create you an user in my site in order to test whatever you need there,
Best regards,

#1
I think that it's by design for simplifying processing. Probably, more complicated processing is needed in order to support multiple role.
However, it may be more useful. You may write the code for implementing that feature and submit a patch.
#2
I use to submit patches when the author is not working in the same issue, as soon as the author answer me, I'll submit a patch if needed, don't worry, and is not complicated at all.
Thanks.
#3
@sfranchi: go for it, i am overloaded now... :S
#4
Ok, as soon as I get it tested I'll post a patch.
#5
@sfranchi any progress on this?
#6
I'm really sorry but I had no time for this yet, during the next week I'll be working on the site wich has users multiple roles and will try to find an "elegant" solution for this.
Best regards, Sandro.
#7
I think that an elegant solution could use role weights.
Regards,
Frederic
#8
Yes, I think so too.
#9
I really enjoy this theme as a admin.
However i would like to see my users have acces to the icon-bar (it's gorgeous).
Could it be simplified by using this module -> http://drupal.org/project/menu_per_role
for role weighing and maybe attaching icons to menu items?
#10
Sure, it should work, but have to be tried in order to see if that module is able to process the visibility of the menu items prior to be used by this theme.
#11
@Maitreya @sfranchi - after reading what menu_per_role does I came to conclusion that it should work with rootcandy
btw sfranchi have you had chance to work out something? if not i'll take over.
thanks
#12
first draft
not finished, but works...
new settings in theme-settings - role weight
#13
committed to dev version
#14
Automatically closed -- issue fixed for 2 weeks with no activity.