I'm creating a site for a horse trainer, and one of the elements required is the ability to post "Training reports" for each horse that only the owner of said horse should have read access to.

I have created:

  • a user group called: "Horse owner"
  • a node type called "Horse" with a field for "Owner" that references the user group "Horse Owner" and links to a specific owner
  • a node type called "Training reports" with a field for "Horse" that references the nodetype "Horse" and links to a specific horse.

But then I'm stomped...

Can anyone point me in the right direction to go from here (views ? a module ? what ?) to ensure that only the owner of a horse can access the training reports for said horse ?

It seems to me that I should be granting access to read the nodes of type "traing report" where field "Horse" matches all the nodes that have "Owner" fields matching the user - but how?

Or can I do this easier and reference the nodetype "Horse" from the user ??

Comments

vm’s picture

http://drupal.org/project/content_access may be a way forward.

another way to accomplish this task would be with the organic groups module where each horse is it's own group and only those with access to the group can view the information about the group.

juliekj’s picture

Thanx, the og module seems to provide a solution.

I'll play around with it for a while to see if it does everything I need :)