Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Registration Auto-assign Role Easily

4 sites No security coverage Drupal 11 · not 10
View on drupal.org

This module automatically assigns Drupal roles to new users during registration based on their selections in a user form field. It also allows for the display of custom icons next to roles on user profiles, without requiring custom code.

Automatically assign Drupal roles to new users at the point of registration, based on the value they select in a list field on the user registration form. No custom code or Rules configuration required — simply map field values to roles through a clean admin interface and the module handles the rest.

Registration Auto-assign Role Easily (RARE) also provides optional per-role icon display. Upload an image for any role, optionally apply a Drupal image style, and display role icons on user profiles via a pseudo-field in Manage Display — no custom theming required.

Use Cases

  • A membership site that offers "Student", "Professional", and "Organisation" account types — the user picks their type at registration and is automatically placed in the correct role.
  • A community platform that displays a badge icon next to each user's name to indicate their membership tier or specialisation.
  • Any site where role assignment currently requires manual intervention by an administrator after each new registration.

Features

  • Multiple mapping rules. Define as many field-to-role rules as your site needs. Each rule independently maps one list field's allowed values to roles.
  • Any list field type. Works with list_string, list_integer, and list_float field types on the user entity.
  • Role icons. Upload a PNG, JPG, GIF, or SVG icon per role (max 2 MB). Optionally apply any configured Drupal image style and show a visible label beneath the icon.
  • Manage Display integration. Role icons are exposed as a pseudo-field ("Role Icons (RARE)") in the user entity Manage Display screen — enable, reorder, and configure per view mode without any custom code.
  • Proper file management. Uploaded icon files are tracked via Drupal's file usage API. Replacing or removing an icon correctly decrements the usage count so Drupal's file cron can reclaim orphaned files.
  • Cache-aware rendering. Role icon render arrays are tagged with config:rare.settings, ensuring cached user profile pages are invalidated whenever icon configuration changes.
  • Clean uninstall. Uninstalling the module removes all configuration and decrements file usage, leaving no orphaned config or permanently-flagged files.
  • No contributed module dependencies. Requires only Drupal core modules: user, field, image and file. The image module is optional and enables image style support for role icons.

Requirements

  • Drupal 11 or later
  • At least one list_string, list_integer, or list_float field added to the user entity (Configuration > People > Account settings > Manage fields)
  • At least one custom role beyond Anonymous and Authenticated
  • The core image module (optional — required only for image style support on role icons)

Installation

Install as you would any Drupal module. See Installing Drupal Modules for instructions.

After installation, navigate to Configuration > People > RARE Settings to configure role assignment rules and role icons.

Configuration

1. Add a list field to the user entity at Configuration > People > Account settings > Manage fields. Add the allowed values that users will choose from at registration (for example: "student", "professional", "organisation").
2. Go to Configuration > People > RARE Settings.
3. Under Role Assignment Rules, select the list field and map each of its allowed values to a Drupal role.
4. Optionally, under Role Icons, upload an icon image for each role, select an image style, and configure the label.
5. To display role icons on user profiles, go to Configuration > People > Account settings > Manage display and enable the Role Icons (RARE) field for the desired view mode.

Similar Projects

Role Assign
Allows administrators to delegate the ability to assign specific roles to other users during user editing. RARE is different — it targets automatic assignment at the moment of registration based on a field value, with no administrator intervention required.

Registration Role
Assigns a single configured role to all new registrants. RARE is different in that assignment is conditional — different roles are assigned based on what the user selects in a form field, and multiple independent mapping rules can run simultaneously.

Rules
A general-purpose event/condition/action automation framework that can be configured to assign roles on registration. RARE is different in that it requires no contributed module dependencies and no Rules knowledge — the mapping is configured through a single focused admin form.

Supporting this Module

Report Bugs: Help improve stability by reporting issues in the issue queue
Submit Patches: Contribute code improvements and new features
Write Documentation: Share your use cases and configuration tips
Spread the Word: Star the project, write blog posts, or mention it in forums

Community Documentation

A great place to add links to YouTube walkthroughs, external documentation, or a demo site (use DrupalPod!).

Depends on

Dependencies of the latest stable release

  • field Drupal core
  • file Drupal core
  • image Drupal core
  • user Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Mar 2026
Latest release
4 days ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.0.2 Stable 11 Aug 27, 2026
1.0.1 Stable 11 Aug 27, 2026
1.0.0 Stable 11 Mar 2, 2026