When user grants access to the node for the relationship member, the relationship member can access the node even if it is unpublished.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | node_access_unpublished.patch | 1.28 KB | berdir |
When user grants access to the node for the relationship member, the relationship member can access the node even if it is unpublished.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | node_access_unpublished.patch | 1.28 KB | berdir |
Comments
Comment #1
anglo commentedRelationship member is granted only the view permission. With the view permission he shouldn't be allowed to access the unpublished node.
Comment #2
berdirYes, there needs to be a check for $node->status in the function user_relationship_node_access_node_access_records().
Should be a trivial, one-line change. I probably will not have time to do this in the next few days, so it would be great if you could provide a patch.
Comment #3
anglo commentedUnfortunately, not that good with node access grants. If you could provide me with the code I can test it.
Comment #4
berdirYou don't need to be good with anything. You just need to extend the existing if case that checks if there is any UR node access related information with a "&& $node->status".
Comment #5
anglo commentedTried yesterday to put it in user_relationship_node_access_node_access_records() both here
if (!isset($node->user_relationship_node_access) && $node->status) {and here
if (isset($node->user_relationship_node_access) && is_array($node->user_relationship_node_access) && $node->status) {Doesn't work. Once the node is published the checkbox "Post to a friend" gets unticked and everyone can see the node.
And I get
Notice: Undefined offset: 1 in user_relationsihp_node_access_update_node() (line 238 of /sites/all/modules/user_relationships/user_relationship_node_access/user_relationship_node_access.module).
Comment #6
mrf commentedNot sure if this has been fixed yet, but updating tags for tracking.
Comment #7
berdirYou probably changed two much if you changed two if statements.
I've justed changed a single diff in the node_access_records() hook and it is working fine for me. Please test the attached patch.
Comment #8
berdirCommitted.