It would be great to have a new Role change event for React on event so that we can perforn an action when a role of a user changed whether a new role(s) assigned or removed. Something similar to Role Change Notify module. Thanks!

Comments

TR’s picture

Status: Active » Closed (won't fix)

You can do that yourself. Either react on user update then use data comparison to see if the unchanged user role set differs from the changed user role set. Or you can implement hook_user_update(), do the comparison in there, then fire a new event that you defined yourself.

There doesn't seem to be any interest in putting this feature directly into Rules. Think about it, if you had a different event to fire on every single user property change, then you would need a LOT of new events. Roles are just one of the things that can change. But Rules doesn't need all those new events because it already has a way to check this with the data comparison.