I looked at #361473: CCK fieldgroup panels doesn't respect CCK field privacy settings.
It did not seem to address integration with the CCK Field Privacy module.

Line 83 of content_access.inc now checks against the results of hook_field_access(), but there is a problem in that CCK Field Privacy is unable to implement the hook because it needs access to the node being checked, which is unavailable through the hook. I don't know any good and sane ways around this without adding the node context to the hook. My solution at the moment is inserting this bit of code in place of line 83, which uses a method implemented in Field Privacy:

  if (module_exists('cck_field_privacy')) {
    global $user;
    if (!is_null(_cck_get_inaccessible_fields($user, $node, $field_name))) {
      return;
    }
  }

This makes cck content inside of panels respect Field Privacy settings. Let me know if there's something I'm overlooking or if anyone has a better idea of what could be done to make my hack unnecessary.

Comments

CPyle’s picture

No sooner did I post this then I reloaded the issue page to find #514452: Add new argument $node to content_access() to enhance the context for hook_field_access(). That might teach me to be more patient.

I'll close this if the patch goes through.

markus_petrux’s picture

Status: Active » Closed (duplicate)

Let me say this issue can now be considered a dup of #514452: Add new argument $node to content_access() to enhance the context for hook_field_access()

That one has been committed. Thanks for testing that patch.