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
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.

AttachmentSize
role_weights-block.patch2.75 KB

#1

leafish_paul - August 4, 2006 - 12:27

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

leafish_paul - February 26, 2007 - 01:21

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

#3

leafish_paul - April 3, 2009 - 09:33
Status:needs review» needs work

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

 
 

Drupal is a registered trademark of Dries Buytaert.