Auto Assign Role

Last updated on
30 April 2025

The Auto Assign Role module http://drupal.org/project/autoassignrole serves two primary purposes. The first is to provide an automatic assignment of roles when a new account is created. The second is to allow the end user the option of choosing their own roles when they create their account. The administrator has full control over these functions and can have them working together or independently of each other.

General Administration

After installing the module you will want to navigate to admin/user/access to grant access to the appropriate roles. The administration page for this module is at admin/user/autoassignrole in Drupal 6 or admin/config/people/autoassignrole in Drupal 7. There are two primary categories of functionality can be quickly enabled or disabled from the admin page. In order for either type of role assignment to work you will need to make sure to click the enable button on the admin page and select the roles to be used in the process.

Automatic Role Assignment

The automatic role assignment uses the hook_user insert operation to automatically add the roles selected by an administrator.

The settings page is at admin/user/autoassignrolein Drupal 6 or is at admin/config/people/autoassignrole/auto in Drupal 7. This page contains two categories of options.
The first option is an enable/disable flag that needs to be set to enabled in order for the module to assign roles. Each role that is available in the system is presented beneath the enable/disable option giving the administrator the ability to select any combination of roles. The role list is not filtered so it is left in the administrators discretion to select appropriate roles. Simply edit the admin page, save your changes, and everything should work.

Per Role Pages (D7) / Assign from Path (D6)

D6: admin/user/autoassignrole
D7: admin/config/people/autoassignrole/pages

The Drupal 6 version is more robust. To get the same functionality in Drupal 7 version you will need to create a block for a ‘Description:’ and place it above ‘Main page content.’

Notes:
You will not see the page if you are logged in (duh).
If you get errors, especially 403, verify ‘Who can register accounts?’ is not ‘Administrators only’ in Home » Administration » Configuration » People » Account settings (admin/config/people/accounts)

User Role Assignment

The user role assignment exposes roles for the public end user to select from when they create their account. The settings page is at admin/user/autoassignrole in Drupal 6 or is at admin/config/people/autoassignrole/user in Drupal 7. This page contains four categories of options. The enabled/disabled and role options work like the Automatic Role Assignment options outlined above. The additional two option sets are for controlling the text displayed to the end user during their role selection process and selecting if the end user can pick multiple roles or only a single role.

Footnote

This is a very simple module that performs a very specific set of tasks. It should be straight forward to install, configure and use. Feel free to post issues, suggestions and comments on the project page at http://drupal.org/project/autoassignrole

Modules extending Auto Assign Role

These modules are not officially endorsed or supported by the authors of Auto Assign Role, but in some ways they may extend this module for more advanced usage.

Help improve this page

Page status: Not set

You can: