Esempio n. 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;
 }
Esempio n. 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;
 }