Closed (won't fix)
Project:
Similar Entries
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2009 at 19:12 UTC
Updated:
12 Aug 2011 at 04:46 UTC
The private module provides a great way to limit viewing of nodes by role. This didn't play nice with similar_entries out of the box, because similar entries would show nodes to the user even if they were not allowed to see them (because of a private module permission).
I was able to use the theme_similar_content to override this by including the following code in the main while block:
// if the site has the "private" module installed, make sure the related node is viewable
if(module_exists("private")) {
if ( ($content->private==PRIVATE_ALLOWED) && (user_access("access private content")==false) ) continue;
}
I thought I'd post it here in case anyone else was trying to do the same thing, or if you wanted to include it in the module (If I've done it correctly). Thanks.
Comments
Comment #1
rahulbot commentedComment #2
jordojuice commentedI certainly think this is an absolutely necessary feature to have - not displaying links if the user does not have access to the node. However, I would tend to shy away from putting module specific checks. If we start doing that then it will have to be done for every node access module that comes along. I'm not too familiar with it, but it's likely that most of these types of modules use node_access restrictions I would assume. so there surely is a better way to go about this.
On a different note, though, the next version of the module will have views integration with which these types of tasks will certainly become easier to accomplish.
Comment #3
jordojuice commentedSince the new version has views integration, this request is obsolete. Reopen if you think otherwise.