Closed (fixed)
Project:
Node Access Auto Reference
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2009 at 11:59 UTC
Updated:
9 Apr 2010 at 10:50 UTC
Related topic: http://drupal.org/node/536082#comment-1873884
Comments
Comment #1
kenorb commentedExample:
node2 is referenced to node1 (nodereference),
node3 is referenced to node2 (nodereference),
node3 is referenced to user1 (userreference),
user1 want to see node1, but node1 have no any direct references
He already have reverse-referenced path (user1 -> node3 -> node2 -> node1).
Implementation:
Method A:
All connection nodes will be checked on the fly in hook_node_access_records() and proper permission for a node will be applied.
Method B:
When user will go to node1 page, permission will be calculated on the fly for checking which nodes are referenced to node1. If found (node2) and user is still not reverse-referenced directly from node2, check which nodes are referenced to node2, etc.
It could be implemented by node_load() for all nodes which could be referenced to node1, or by some complicated db query.
Method C:
All connection nodes will be generated and saved into special table. It will be less resourceable, but it have to be refreshed each time, when node are rebuilt (so performance probably will be the same as Method A).
In my opinion Both A and B method should be implemented. Probably it could be done without C.
Comment #2
kenorb commentedhttp://drupal.org/cvs?commit=245366
http://drupal.org/cvs?commit=245442
Comment #3
vistree commentedAh, I see. Is this allready something I can test? Or are this patches the ones, you allready mentioned in this post?
Kind regards and nice evening
Kai
Comment #4
kenorb commentedI've added new option and made environment for a new feature, added some additional debug messages, but it does't work yet. I'll try to continue this on Monday.
Comment #5
kenorb commentedI've done parent and reverse-referenced (but not tested yet).
In your case just tick 'Check permission via owners.' option from settings which should solve your issue.
Comment #6
vistree commentedHi kenorb,
this is great!!! I will try and report - thank you so much!
Do I have to use the latest version (1.1.2.7) or the one with highest number (1.1.2.10)?
Kind regards
Kai
Comment #7
vistree commentedHello again,
so I installed the 1.1.2.10 patch - hope this was correct.
With this version I have some trouble:
1. all content says: Connected NO - even the own content. But it is displayed.
2. If I check "check permissions via owners" also all pages are with status "connected No", but this time I can see ALL content, even the one not connected to my related user in any way (created a page as root, view_own tells only to view own --> but userX can see content (without userreference) from admin).
Kind regards
Kai
Comment #8
kenorb commentedYou have to upgrade 3 files:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/nodeaccess_...
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/nodeaccess_...
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/nodeaccess_...
And then re-try please.
There will be no referenced connection if you own that. Connection is found only through field references or if you are connected to the node which you owns.
Comment #9
vistree commentedSorry, I did not recognize, that the patches are for different files ...
OK, I updated all three now.
Following result:
If I use the "check perm by owner" there seems still something to be wrong.
If I check this option (without checking the new option for reverse reference, users have access to ALL nodes of a content type where they have view_own access for own. If I uncheck the option, the connections seems to be correct (for referenced node and childs - but not for the parent).
Checking the reverse reference seems to have no effect by now.
The connection messages seems to be correct now - all I can see, I also have a "connection = yes".
If you want, I can sent you login data to my test system by PM.
Kind regards
Kai
Comment #10
kenorb commentedYes, if you can, please send me prv.
I'll check that tomorrow, then I'll better know how it's exactly connected.
Comment #11
IncrediblyKenzi commentedThe CNR module may be useful in this case as well.. It maintains two-way references (may-to-one, one-to-many, respectively) between node types: http://drupal.org/project/cnr
-=A
Comment #12
kenorb commentedFeature already implemented.
If there are any issues related to it, please raise the new issue.