drupal-eca-recipe/eca_lib_0010

Detect user role changes

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Type:drupal-recipe

dev-main 2024-08-07 10:59 UTC

This package is auto-updated.

Last update: 2024-11-07 11:29:58 UTC


README

ID: eca_lib_0010

When a user entity gets saved, this model compares the list of original and current roles of that user and finds out, which ones got added and which ones got removed.

This involves 2 loops where we first go through the list of current roles to see if one of them is missing from the list of original roles. Then we gro through the list of original roles to see if ones of them is missing in the list of current roles.

For each missing role, this model shows a message on screen.

Installation

composer require drupal-eca-recipe/eca_lib_0010
cd web && php core/scripts/drupal recipe ../vendor/drupal-eca-recipe/eca_lib_0010