Problems with users with multiple roles

sfranchi - October 27, 2008 - 23:51
Project:RootCandy
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:sign
Status:closed
Description

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

Takafumi - October 28, 2008 - 15:51
Version:6.x-1.0-rc3» 6.x-1.x-dev
Category:bug report» feature request
Priority:critical» normal

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

sfranchi - October 28, 2008 - 16:22

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

sign - October 28, 2008 - 16:53

@sfranchi: go for it, i am overloaded now... :S

#4

sfranchi - October 28, 2008 - 17:15

Ok, as soon as I get it tested I'll post a patch.

#5

sign - December 2, 2008 - 08:54

@sfranchi any progress on this?

#6

sfranchi - December 2, 2008 - 12:45

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

flebas - December 3, 2008 - 01:43

I think that an elegant solution could use role weights.

Regards,
Frederic

#8

sfranchi - December 3, 2008 - 13:34

Yes, I think so too.

#9

Maitreya - January 16, 2009 - 13:10

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

sfranchi - January 16, 2009 - 15:17

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

sign - February 12, 2009 - 11:17

@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

sign - February 15, 2009 - 14:52
Assigned to:Anonymous» sign
Status:active» needs work

first draft
not finished, but works...

new settings in theme-settings - role weight

AttachmentSize
rc_role_weights.patch 2.03 KB

#13

sign - February 18, 2009 - 15:33
Status:needs work» fixed

committed to dev version

#14

System Message - March 4, 2009 - 15:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.