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.
| Comment | File | Size | Author |
|---|---|---|---|
| role_weights-block.patch | 2.75 KB | nedjo |
Comments
Comment #1
pfaocleI 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.
Comment #2
pfaocleJust noticed a new module - rolechanger - might be worth a look in relation to this?
Comment #3
pfaoclerole_weights_change_role_submit() should use $form_state to redirect. Also needs checking against recent HEAD + Drupal 6.
Comment #4
pfaocleComment #5
pfaocle