I have a certain content type in which I have a user entity reference select list that is invisible to users/editors.
The idea is that the creator of the request has to choose a role of employees to who he sends this node, and then the other users can either accept or reject it, and only if ALL employees reject, the node would actually go to a rejected state, unlike the usual way of working with workbench.
To do this, I have the invisible user-entity reference field. Now I want to achieve the following:
- When creating the node, after save, I want the reference field to automatically select all the users of the chosen role
- By clicking a button 'reject', I want to remove the current user from the selected list.
- When no users are selected, the node gets rejected.
Option 2 & 3 are easily done with rules. However, phase 1 is where I'm struggling. So I have the complete list of users, but now I have to "select" them, which I can do with rules by using "add to list". However, the selector only gives me the options "entities" and "site", in which site only includes "current-user", "current-page" and "feed-node".
How can I make it select all users of a certain roles?