Nodeaccess 6.x-1.3
User Relationships 6.x-1.0
I am using "Content Profile" to create profile nodes. I am using "User Relationships" to create a "friend" relationship.
I have "Nodeaccess" set so that the grant tab for a profile node shows an option to allow "view" permission to the role "authenticated users", and an option to allow "view" permission to the relationship "friend".
Setting or unsetting "view" for the "authenticated users" role works great, but if I unset "view" for "authenticated users" and set "view" for "friend", friends of the profile owner cannot view the profile.
the node_access devel block shows
realm gid view update delete
nodeaccess_relationships 1 1 0 0
Searching for a user and adding him directly also works fine.
Has anyone else tried something similar? If so, what might be the problem?
Thanks,
- L0rne
Comments
Comment #1
l0rne commentedThe problem was that function nodeaccess_node_grants uses arg(1) to get the nid, so it cannot work with the profile node, because the page we are working with has arg(0) = "user" and and arg(1) = uid.
I added some code to handle the content profile situation. This is the full function, with my modifications. Seems to be working fine.
Yours,
- L0rne
Comment #2
vlad.pavlovic commentedWhile I definitely appreciate your effort, your addition would make nodeaccess dependent on Content Profile and in my opinion is more of a feature request (ie: support for Content Profile module). I would be tempted to add it for the Drupal 7 version, but I am not adding anything to the Drupal 6 version beside bug fixes.
If you wanted Profile 2 to be considered for Drupal 7, please open a new issue as a feature request.