/** * Generate query for searching all content. * * @return null */ protected function generate_search_all_query() { $contrib_types = $this->types->get_ids(); $restrictions = array(TITANIA_SUPPORT => $contrib_types, TITANIA_CONTRIB => $contrib_types, TITANIA_FAQ => $contrib_types); // Enforce permissions on the results to ensure that we don't leak posts to users who don't have access to the originating queues. $access_queue_discussion = $this->types->find_authed('queue_discussion'); $access_validation_queue = $this->types->find_authed('view'); if (!empty($access_validation_queue)) { $restrictions[TITANIA_QUEUE] = $access_validation_queue; } if (!empty($access_queue_discussion)) { $restrictions[TITANIA_QUEUE_DISCUSSION] = $access_queue_discussion; } $this->engine->set_granular_type_restrictions($restrictions); }