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.

CommentFileSizeAuthor
role_weights-block.patch2.75 KBnedjo

Comments

pfaocle’s picture

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.

pfaocle’s picture

Just noticed a new module - rolechanger - might be worth a look in relation to this?

pfaocle’s picture

Status: Needs review » Needs work

role_weights_change_role_submit() should use $form_state to redirect. Also needs checking against recent HEAD + Drupal 6.

pfaocle’s picture

Version: master » 7.x-1.x-dev
Assigned: nedjo » Unassigned
pfaocle’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)