When an unauthorized user tries to access a private content by typing its URL, the call to drupal_access_denied() in og_orivate_content_nodeapi() generates an infinite recursion on my Drupal install.

I think the right way to prevent access to private content would be to use the node access system (by implementing hook_node_access_records() and hook_node_grants()).

Patrick

Comments

cghobbs’s picture

pfournier your right that would be a much better approach than what I've cobbled together so far and I do hope to do that soon. I had a bit of trouble getting that to actually work when I first tried it but I stumbled across this module that I think will be helpful to borrow from: http://drupal.org/project/private The use case is very similar accept that it doesn't work for OG.

branana’s picture

Removed extraneous call to drupal_access_denied()

branana’s picture

Status: Active » Needs review
johannez’s picture

Assigned: Unassigned » johannez
Status: Needs review » Fixed

Now when you try to access a private content node as an unauthorized user you will guided to the login page.

johannez’s picture

Status: Fixed » Closed (fixed)