One role per user
walker2238 - July 2, 2008 - 01:40
| Project: | User Points Contributed modules |
| Version: | 5.x-3.0 |
| Component: | Code: userpoints_role |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
So I'll cut to the chase here. Is there a way that each user can only obtain a single role?
As of now I'm using the User Badges with user_roles and user points. The thing is I'd like the user to only have one badge displayed at a time.
Example: When user with role (A) moves on to role (B) then that user loses role (A).
As of now I can only get the user to add roles onto their existing roles. Any help would be great.

#1
Not without writing custom code.
Take the userpoints_role as a starting point and modify it to do that. It is not that hard.
#2
Thanks for the fast reply, I'll give it a shot although my php skills are limited. I'll post back to let you know how it went.
#3
I am looking to do the same thing. Have you had any luck with this walker? I have gotten the module to remove the last assigned role but then add_role assigns all of the other roles back to the user instead of only adding the highest one the user can obtain. And it sounds so simple in theory, but man, I'm having a tough time!
Any help would be appreciated. Not a direct code paste, just some helpful hints. I'm new to Drupal and even PHP itself, so anything I can somewhat figure out myself would help me learn a bit more.
Thanks guys.
#4
Nope sorry no luck at all I only briefly viewed things and actually some how messed everything up so I had to re-install the module. I guess you could say I'm Tim the tool man Taylor of php. Maybe someone else will have better luck then we are having.
#5
It's been almost 4 months... Wondering if anyone's done this, yet, because I want to do the same thing. I thought that is how the module would work and was surprised to post and then get notified that I had just gained 5 roles. Yikes. Good thing I posted before any users. LOL
Michelle
#6
bump... curious if theres any progress on this...