1

I have the following challenge: I have 4 roles, let's call them Group1 ... Group4. I have different content types and I segregate access of those types using the Taxonomy Access Control module. So users from Group1 can only view and edit nodes that have term Group1.

Now, I have the challenge to change a term reference field of these content types automatically. So if a user from role Group1 creates a new node, that node will have a term reference field with term Group1.

I don't want users to edit on their own to avoid human errors.

1
  • Have you tried anything yet? Rules? Custom coding? And are you sure you need a field? If it's always same term for given author, why not to process this at display stage, for example?
    – Mołot
    Commented Oct 26, 2015 at 8:57

2 Answers 2

0

All you need to do is create separate fields for respective roles. Use Field permissions module. Or if you want to have role wise access like from editor -> moderator -> pulisher etc. Use workfolw module.

0

Use the Rules module to create 4 similar rules (1 for each group), which would look like so (for Group1):

  • Event: before saving content
  • Condition: user has role Group1
  • Action:
    1. Set a data value.
    2. Select the taxonomy term reference field to set.
    3. Select the taxonomy term 'Group1' (if needed: use the "Switch to the direct input mode" button to reveal the terms available in your taxonomy).

Repeat the above steps for Group2, 3 and 4 to create a similar rule.

You might want to try to consolidate those 4 (similar) rules in a single rule, by using the Rules Conditional module: the condition for each group would be replace by a similar "if condition" (contained in the rules action), and the Rules action for each group would only be executed if the "if condition" would be true. For a sample using the Rules Conditional module (for which there is not a lot of docu available), refer to my answer to the question "How to prevent a node being saved when using the Rules module?".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.