$item) { if (!($item instanceof \ElggRiverItem)) { continue; } if ($item->type == 'object') { continue; } if ($item->subject_guid == elgg_get_logged_in_user_guid()) { continue; } if (elgg_is_admin_logged_in()) { continue; } if (elgg_get_ignore_access()) { continue; } unset($return['items'][$key]); } } return $return; } /** * Add a custom access clause for river queries * * @param type $hook * @param type $type * @param array $return * @param type $params * @return type */ function river_access_query($hook, $type, $return, $params) { // anything else we can use to isolate river queries? // currently 'oe' is only used in core by river queries // but it's not really a great way to judge... if ($params['table_alias'] != 'oe') { return $return; } if ($params['ignore_access']) { return $return; } if (elgg_is_admin_logged_in()) { return $return; } $guid = (int) elgg_get_logged_in_user_guid(); $return['ands'][] = "((rv.type != 'object' AND rv.subject_guid = {$guid}) OR rv.access_id != 0)"; return $return; }