6.x version of http://drupal.org/project/cck_field_privacy will support a hook that lets other modules deny access to CCK fields. Need to implement the hook cck_field_privacy_access($from, $to) that will return true iff there is an established relationship between user $from and user $to. Background info in http://drupal.org/node/314170

Thanks to @DaniOrama and @mercmobily for the tip!

Comments

obsidiandesign’s picture

Status: Active » Needs review
StatusFileSize
new928 bytes

I had a spare hour or so, so I created a patch to test against 6.x-1.x that incorporates the cck_field_privacy_access hook. Could someone (alex?) give it a look over, to make sure I implemented the UR code correctly?

Bryan O'Shea
Obsidian Design

alex.k’s picture

Status: Needs review » Fixed

Almost correctly. I've only added another parameter to only count approved, not pending relationships.

$relationship = user_relationships_load(array('between' => array($requestee->uid, $requester->uid), 'approved' => TRUE), array('count'=>TRUE), FALSE);

Thanks much @obsidiandesign, appreciate it.

Committed, it will show up in the dev release in a few.

Status: Fixed » Closed (fixed)

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

joe9’s picture

Hello alex,

can you please give me a hint how to get "cck_field_privacy" to work with "user relationships". I'm using the dev-Version of "user relationships", where the code extension you posted here has already been integrated. My problem is that the relationships I create with "user relationship" don't appear in the jQuery Impromptu pop-up that is revealed by clicking on the padlock icon.

Can you help? Thank you!

socialnicheguru’s picture

I have the same question. When I set it up, I see "buddies" but not my relationships.

Thanks,
C