Can someone give me a pointer on what code I might use in a content template to restrict access to a node based on the relationship one has with the node's author? I just need a hint on the logic/variables I would use to, say, restrict access to a given text field based on their "client" relationship status.

Comments

alex.k’s picture

You can look at the user_relationships_load() function. Check the docs for it, as it can run a number of different queries. In your case I'd do something like

user_relationships_load(array("between" => array($uid1, $uid2)))

You would iterate over all returned relationships, checking if the desired one is present.

or, try this for more precision:

user_relationships_load(array("between" => array($uid1, $uid2), "rtid" => $client_relation_type_id))
alex.k’s picture

Assigned: Unassigned » alex.k
Status: Active » Fixed

Cleaning up the issue queue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.