I have some content type with a term reference field (think a magazine site where news are linked to a category).
I must block the node view for a user role, but I don't want to set this access for single node (like tac/tac_lite do), but for single category linked to the node (via term reference field). For example I want that role "FOO" can see node of category "BAR" but not nodes of category "XYZ", where "BAR" and "XYZ" are terms od f the same vocabulary.
My idea is this:
- add a select list field to the vocabolary's fields (and the allowed values will be the role's ID) so that I can link role to each category/term
- when a user try to access to a node, I check (via hook_node_access() ) that current user's role is available in the node's category fields (that I have setted in previos step).
Is there a better way ?
M.