Question

I have one content type 'object' that references one or more nodes of content type 'image'.
I'm granting access to nodes with TAC Lite: a user can view only content with a particular term.
Since the term is present only in the 'object' content type, the images referenced are not displayed in the node page.
How can I grant view access to all referenced nodes?

I've tried with Node access node reference, but it grant access to the parent node if the user has access to referenced nodes.

Was it helpful?

Solution

You could dynamically add the the same tag to the referenced image nodes when the 'object' node is created (or updated). To do this, you'd implement hook_nodeapi() and check the $op parameter for either "insert" or "edit" (depending on when you want this operation to happen). Then you can pull out the node id's of the 'image' nodes being referenced and apply the terms. This way they have the same taxonomy based permissions at the 'object' node.

There may be other ways, but this seems like it should work for you. I actually do the same thing to set a CCK node reference value during creation. I don't have access to a coding environment right now, or I'd add code snippets.

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top