Is there a way to add a rule that can do a certain action when a user's role is changed?
A:
I do not know if the trigger/action modules or some extension modules for these offer this (might be worth a check), but if not, you'd probably need to implement hook_user()
for the 'update'
operation.
There you'd need to compare the $edit values against the $account values to check for a change of role(s). Be aware that at this point the change is not yet 'commited', so the update could still fail. Depending on what you want to do on a role change, you might need to put some marker in the $edit array so that you can react to a successful submission later on (e.g. in the after_update
operation).
Henrik Opel
2009-09-08 19:28:40