Closed (works as designed)
Project:
Rules
Version:
7.x-2.2
Component:
Rules Core
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2013 at 04:49 UTC
Updated:
7 Mar 2019 at 06:44 UTC
Jump to comment: Most recent
Comments
Comment #1
spidersilk commentedWere you ever able to solve this, Rosamunda? I'm having the same issue.
Comment #2
tr commentedWell the use case is a little vague - when you say "assign a user to a specific group each time the newly created user is given a specific role" and you show the event as "After saving a new user account", that indicates to me that the Rule you are writing only triggers when the user is created for the first time. But that contradicts the second part of your statement "each time the ... user is given a specific role" because that is not something that happens when the user is created for the first time - you're describing a user being MODIFIED, or updated and the user's list of roles being changed.
So I would reaction on "After updating a user", I would first check to see if the roles have changed and if they have then loop over the list of roles and set the group based on the role. To do this, you will need to create data somewhere that has a map of which role gets which group. You could do this with a taxonomy vocabulary if you don't want to program, but it would be more efficient and easier IMO to write a custom action which sets the groups for your roles.