Allow users to select role for session (through block)
nedjo - June 25, 2006 - 20:07
| Project: | Role Weights |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | nedjo |
| Status: | needs work |
Jump to:
Description
As we build substantially different experiences based on role, it will be important to enable users to choose which role to use as primary for a given session.
This patch introduces a block where users can do that. The selected role is saved in a session variable. We introduce a new method, role_weights_get_user_primary(), that returns the selected session role if there is one, or if not the user's highest weighted role.
| Attachment | Size |
|---|---|
| role_weights-block.patch | 2.75 KB |

#1
I like the idea (am about to play with patch).
The only suggestion I have is that perhaps a permission is needed? I think in a lot of cases a site admin won't want ordinary users to essentially be able to select their own highest role - the ones set by the admin should stick.
#2
Just noticed a new module - rolechanger - might be worth a look in relation to this?
#3
role_weights_change_role_submit() should use $form_state to redirect. Also needs checking against recent HEAD + Drupal 6.