Detect user role changes¶
Version v1
Purpose¶
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.
Dependencies¶
- module
- eca_base
- eca_content
- user
Used plugins¶
Events¶
Conditions¶
- Compare number of list items
- Compare two scalar values
- Compare two scalar values
- Compare number of list items
- Compare two scalar values
Actions¶
- Load the original user entity
- Get the list of current roles
- Get next role
- Message that the role is new
- Join original IDs
- Join current IDs
- Get the list of original roles
- Get next role
- Message that role has been removed
Changelog¶
v1
-
Initial version
Last update:
September 22, 2023 15:16:04