Skip to content

Commit

Permalink
Merge pull request #117 from tripal/node-access
Browse files Browse the repository at this point in the history
Make sure to index nodes only if they are accessible to anonymous users
  • Loading branch information
almasaeed2010 committed Dec 11, 2017
2 parents caa0438 + 76ccb5f commit 98340f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions includes/Jobs/NodesIndexJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,15 @@ protected function loadContent($records) {
if (!isset($nodes[$record->nid])) {
continue;
}

$node = $nodes[$record->nid];

if(!node_access('view', $node)) {
// Anonymous user is not allowed to access this node
// so don't index it
continue;
}

$modules = module_implements('node_view');
foreach ($modules as $module) {
module_invoke($module, 'node_view', $node, 'full', NULL);
Expand Down

0 comments on commit 98340f2

Please sign in to comment.