drupal-eca-recipe/eca_lib_0026

Grant new user role after 3 conditions are met

Installs: 36

Dependents: 0

Suggesters: 0

Security: 0

Type:drupal-recipe

3.2.3 2025-08-10 14:12 UTC

This package is auto-updated.

Last update: 2025-08-10 14:14:44 UTC


README

ID: eca_lib_0026

This model automatically adds or removes a role from a user, when this gets updated, depending upon 3 conditions that are stored with the user entity. Only if all 3 conditions are met, the role gets added. In all other cases the role gets removed.

The creation of this module was recorded and the video with additional explanations can be watched here.

Installation

## Import recipe
composer require drupal-eca-recipe/eca_lib_0026

# Apply recipe with Drush (requires version 13 or later):
drush recipe ../recipes/{{ rawid }}

# Apply recipe without Drush:
cd web && php core/scripts/drupal recipe ../recipes/eca_lib_0026

# Rebuilding caches is optional, sometimes required:
drush cr