Download & Extend

Allow users to select role for session (through block)

Project:Role Weights
Version:master
Component:Code
Category:feature request
Priority:normal
Assigned:nedjo
Status:needs work

Issue Summary

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.

AttachmentSize
role_weights-block.patch2.75 KB

Comments

#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

Status:needs review» needs work

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