Reference Blocked Users adds a permission that lets a role pick blocked users as well as active users in user reference fields and in the "Authored by" field. It is for editorial sites.

Editors who lack "Administer users" get Drupal's default user selection. Give them "Reference blocked users" instead, and they do not need broader user administration access.

Start here

See it working

These steps show the permission on a test site with an editor role. They create two user reference fields on the Article content type and then sign in as an editor.

Create four users and one role

The test site's users and the editor role used in the steps below

Install the module and give the editor role the permission

The Permissions page with the Reference blocked users permission checked for the editor role

Create two user reference fields on the Article content type

The first field includes the anonymous user and all roles.

 anonymous user included and no role filter

The second field excludes the anonymous user and filters by the editor role only.

 anonymous user excluded and filtered by the editor role

Sign in as an editor and add or edit an article

The "Authored by" field, as the editor sees it.

The Authored by field on an article form with its autocomplete list

The first new field, as the editor sees it.

The first user reference field with its autocomplete list

The second new field, as the editor sees it.

The second user reference field with its autocomplete list

Features

  • Reference blocked users: A permission, described as "Permission to reference all users (active/blocked) in entity reference user field and in Authored by field". Grant it to any role.
  • Selection plugin: The module adds a selection plugin named "Reference Blocked Users" for user reference fields. It applies to a user who has this permission and does not have "Administer users". Everyone else keeps Drupal's default behavior.
  • Field options still apply: A field that excludes the anonymous user still excludes it, and a role filter still limits the list. Access checking stays on.
  • Search by email address: For users the plugin applies to, typing text in the autocomplete matches the username or the email address.
  • No settings page: The module has no settings page, no database updates and no submodules. The permission is the only control.

Installation: get started in 3 steps

  1. Install the module with Composer:
    composer require drupal/reference_blocked_users
  2. Enable it on the Extend page, or with Drush:
    drush en reference_blocked_users
  3. Open the Permissions page and grant "Reference blocked users" to the roles that should reference blocked users. Check it by editing an article as a member of that role.

Requirements

  • Drupal 11.3 or later, including 12
  • The PHP version your Drupal core requires

Reference Blocked Users needs no other modules or projects.


Support and maintenance

Questions, ideas, and bug reports are welcome. Please use this project’s issue queue so discussions and solutions remain available to the Drupal community.

Maintainers monitor issues, but response times depend on availability.

Flash Web Center, LLC. Drupal sites, themes and modules. Built and maintained by Alaa Haddad.

Developed and maintained by Alaa Haddad of Flash Web Center, LLC.

AI disclosure: AI tools assisted with drafting and reviewing this project description. The maintainer verified the final content against the project source.

Supporting organizations: 
Drupal development
Drupal hosting and maintenance

Project information

Releases