Example #1
0
 /**
  * @return array
  */
 private function getAllowedIndexes()
 {
     $allowedIndexNames = [];
     $indexNames = $this->searchManager->getIndexNames();
     foreach ($indexNames as $indexName) {
         $indexConfiguration = $this->indexConfigurationProvider->getIndexConfiguration($indexName);
         if (!$indexConfiguration) {
             $allowedIndexNames[] = $indexName;
             continue;
         }
         if ($this->securityChecker->hasPermission($indexConfiguration->getSecurityContext(), 'view')) {
             $allowedIndexNames[] = $indexName;
         }
     }
     return $allowedIndexNames;
 }
Example #2
0
 /**
  * @return array
  */
 private function getAllowedIndexes()
 {
     $allowedIndexNames = [];
     $indexNames = $this->searchManager->getIndexNames();
     foreach ($indexNames as $indexName) {
         $indexConfiguration = $this->indexConfigurationProvider->getIndexConfiguration($indexName);
         if (!$indexConfiguration) {
             $allowedIndexNames[] = $indexName;
             continue;
         }
         $contexts = $indexConfiguration->getContexts();
         if ($this->securityChecker->hasPermission($indexConfiguration->getSecurityContext(), PermissionTypes::VIEW) && (empty($contexts) || array_search('admin', $contexts) !== false)) {
             $allowedIndexNames[] = $indexName;
         }
     }
     return $allowedIndexNames;
 }
Example #3
0
 /**
  * Returns page indexes.
  *
  * @return array
  */
 private function getPageIndexes()
 {
     return array_filter($this->searchManager->getIndexNames(), function ($index) {
         return preg_match('/page_(.*)_published/', $index) > 0;
     });
 }