Hello,

I have a drupal 7 website with the following structure:

  • a vocubulary: "Color"
    which has terms: (red, blue, green).
  • nodes
    which has a term_reference field related to "Color" vocubulary.
  • user profile (from durpal core):
    which has a term_reference field realted to "Color" vocubulary.

I need to apply access control so that:
only users with term_reference = "blue" have access (full: view/edit/delete and view in other lists) to nodes with term_reference = "blue", and so on.

Is this possible without using Taxonomy Access Control module and converting term_references into roles? Is there any modules that I can use? Or should I write a custom access control module? What is the best practice?

Thanks in advance

Comments

nevets’s picture

Why not use the taxonomy access module?

hakeem’s picture

Thank you nevets.

Well, let me explain more.

The main classification domain in my website is "Color", which applies for both nodes and users. If I use TAC, I should make pairs (term, role) for every color, and this is impractical because there is many colors (> 50) in the vocabulary and they increase by time, in addition to the time and care required to set up taxonomy-based permissions for each role in TAC.

Therefore, I'm thinking of using term_references to Color terms as the only single way for any association between users and nodes.

I hope this explanation is clear.

WorldFallz’s picture

seriously-- it's the whole point of taxonomy_access which has now been adopted by acquia so will likely receive solid maintenance and support.

In any case, you can also use rules to automatically create a role for a term or if you don' already use rules, there's the single purpose role_vocabulary module as well.

hakeem’s picture

Because the Color vocabulary has a hierarchy, which is not supported by role_vocabulary module which acts in a one way only (roles --> terms).

WorldFallz’s picture

roles don't have a hierarchy, so I'm not sure how the module could support it. Seems like you're left with rules or custom code then.

shadcn’s picture

It might be overkill but I see some OG in that -> Users in a group can only edit content in that group ?