This is really three bugs in one but I'm posting it as a single issue because they all seem to have been created by recent updates. What I mean is that, as of Moshe's fix to "always grant the 'authenticated user' role to authenticated users", (for example) all three of these worked fine, so the changes that have caused this have to be fairly recent.

Running:
drupal 4.7.0 - beta-3
standard build on MySQL

Bugs:
default authenticated user role - disappeared
If you go to edit a user, the role does not appear in the roles list any more.

default authenticated user role - not assigned
When a new user joins, they are not assigned this role. In fact, they are not assigned any role at all.

default authenticated user role - unchangeable
Previously, it was possible to change the name field in the role table in MySQL from 'authenticated user' to whatever you want. I notice now from browsing the system files that the term 'authenticated user' appears in the code in at least three places. Does this mean that we can no longer just rename the role in the database?

Regards

Patrick

Comments

Patrick Nelson’s picture

OK, I realise now that I've missed something and that the move to not having the default role appear in the selectable user roles list is a deliberate one, so that answers the first 'bug' listed above.

I've also realised that the new user does seem to have the rights that I selected for that role. Is that right? If so, it answers the second 'bug' listed above.

So, could someone tell me if it is still possible to rename the authenticated user role in the database (third 'bug' above)?

greggles’s picture

Patrick - good detective work. It appears that you've answered most of your own questions already.

The train of comments makes it sound like the goal was to use rid and not the role description, so if there are places where it is used, then those are probably not the right way to go:
http://drupal.org/node/44379#comment-65649

I did a quick search of current CVS to find these places and came up with:

These two make sense - you could change them for your situation:
database/database.mysql:INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
database/database.pgsql:INSERT INTO role (name) VALUES ('authenticated user');

I'm not so sure about these two:
includes/session.inc: $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
modules/user.module: $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
modules/user.module: $form['account']['roles'] = array('#type' => 'checkboxes', '#title' => t('Roles'), '#default_value' => array_keys((array)$edit['roles']), '#options' => $roles, '#description' => t('The user receives the combined permissions of the %au role, and all roles selected here.', array('%au' => theme('placeholder', t('authenticated user')))));

Patrick Nelson’s picture

Greggles,

Thanks for the response. Not being able to understand fully why the role name appears in these places, I've taken the step of changing the role name in all the places you mention.

So far everything seems to work fine. I'll keep you posted if you wish.

greggles’s picture

Priority: Critical » Normal

Did you change them in a manner that is generalized (e.g. using role id instead of the text) or did you just change the text?

If you changed it to use the role id where appropriate, perhaps you could roll that into a patch and provide it here.

Also, did you mean for this to be critical or was that just because critical is the default. I changed it to "normal" because that seems more appropriate to me.

Patrick Nelson’s picture

I'm afraid I just changed the text - haven't really touched the code either.

Also, sorry about the 'critical' posting - I ALWAYS miss that!!

Jaza’s picture

Version: 4.7.0-beta3 » 4.7.0
Status: Active » Closed (works as designed)

As you can see from reading http://drupal.org/node/44379, all of the things that are described here as 'bugs', are in fact done by design:

1) Authenticated user role disappeared: that's right, this role no longer has an entry in the database - since it applies to all registered users, it simply exists in memory by default.

2) Authenticated user role not assigned: not in the database, but it is automatically assigned to user objects in memory.

3) Authenticated user role unchangeable: this has been by design forever - this role has been locked for as long as I can remember, and that's definitely by design.