Project:Auto Assign Role
Version:6.x-1.0-beta3
Component:User interface
Category:bug report
Priority:minor
Assigned:Unassigned
Status:needs work

Issue Summary

I have a mix of roles, about half of which are user-choice at registration (ex. "Member", "Guest"), and half of which are assigned by administrator only (ex. "Editor", "Administrator"). Not all overlap, eg. an "Editor" is neither a Member nor a Guest. However, I want to require a user-registration to select either Member or Guest.

The problem occurs when an Administrator is trying to add a new user who is an Editor. When an administrator creates a new user, AAR adds its own fieldset for roles just below the full administrator assign roles list. This forces the administrator to give the newly created editor either the Member or Guest role as well, just to get past the AAR validation.

Seems like there's no good reason for AAR to be enabled on the administer/add user page. Only gets in the way. Easiest just to take it out.

Comments

#1

I Agree

#2

I agree. It would suit my configuration if it would only show the roles designated as the ones to be shown.

http://localhost/admin/user/autoassignrole

at "User Role Assignment"

and only 2 of 5 roles selected to be selectable by end user, all roles are always shown to the end user during sign up and not just the 2.

#3

Status:active» fixed

Added a flag to disable auto role assignment in the admin area.

http://drupal.org/cvs?commit=253396

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#5

Status:closed (fixed)» active

The option is available only for "Automatic Role Assignment" section, not for the "Allow User to Choose" section.

#6

@FiNeX looking forward to your patch

#7

@cyberswat: I really like to have the time and possibility to prepare a patch :-(

#8

Anyway later I've to put my hands in the sourcecode, maybe I could try to look this too :-)

#9

I'm looking on it... but instead of a new option, I suggest to simple remove the autoassign field generated by the "allow users to choose" if the current user is the webmaster which already have the possibility to se all roles.

I've started to add the option (something like commit http://drupal.org/cvs?commit=253396 ) but maybe it is better to don't add another option (un-useful) and directly remove the un-needed form.

If you agree I can do the patch.

Let me know.

bye

#10

@FiNeX I can understand what your describing and it seems to make sense. Go ahead and submit the patch so we can test it out. Thanks!

#11

@Cyberswat: ok, tomorrow I'll try to prepare a patch... bye :-)

#12

ping

#13

Status:active» needs review

pong :-)

the patch is trivial. I've tested it and it works perfectly.

--- autoassignrole.module 2009-08-25 15:04:44.000000000 +0200
+++ autoassignrole.module.new 2010-02-05 23:10:15.829718623 +0100
@@ -186,6 +186,9 @@ function autoassignrole_user($op, &$edit
       $account = user_load(array("uid" => $account->uid));
     break;
     case 'register':
+      if (arg(0) == 'admin') {
+        return;
+      }
       if (_autoassignrole_get_settings('user_active') == 1) {
         $roles = user_roles(TRUE);
         $user_roles = _autoassignrole_get_settings('user_roles');

#14

Status:needs review» needs work

Please submit a legitimate patch

nobody click here