/** * Sets the internal filters based on the given configuration. * * @param array $filterSettings The filter settings * @return void */ protected function buildFiltersFromSettings(array $filterSettings) { foreach ($filterSettings as $singleFilterSettings) { /** @var $requestPattern \TYPO3\Flow\Security\RequestPatternInterface */ $requestPattern = $this->objectManager->get($this->requestPatternResolver->resolveRequestPatternClass($singleFilterSettings['patternType'])); $requestPattern->setPattern($singleFilterSettings['patternValue']); $interceptor = $this->objectManager->get($this->interceptorResolver->resolveInterceptorClass($singleFilterSettings['interceptor'])); $this->filters[] = $this->objectManager->get(\TYPO3\Flow\Security\Authorization\RequestFilter::class, $requestPattern, $interceptor); } }
/** * Sets the internal filters based on the given configuration. * * @param array $filterSettings The filter settings * @return void */ protected function buildFiltersFromSettings(array $filterSettings) { foreach ($filterSettings as $singleFilterSettings) { $patternType = isset($singleFilterSettings['pattern']) ? $singleFilterSettings['pattern'] : $singleFilterSettings['patternType']; $patternClassName = $this->requestPatternResolver->resolveRequestPatternClass($patternType); $patternOptions = isset($singleFilterSettings['patternOptions']) ? $singleFilterSettings['patternOptions'] : []; /** @var $requestPattern \TYPO3\Flow\Security\RequestPatternInterface */ $requestPattern = $this->objectManager->get($patternClassName, $patternOptions); // The following check needed for backwards compatibility: // Previously each pattern had only one option that was set via the setPattern() method. Now options are passed to the constructor. if (isset($singleFilterSettings['patternValue']) && is_callable([$requestPattern, 'setPattern'])) { $requestPattern->setPattern($singleFilterSettings['patternValue']); } $interceptor = $this->objectManager->get($this->interceptorResolver->resolveInterceptorClass($singleFilterSettings['interceptor'])); $this->filters[] = $this->objectManager->get(RequestFilter::class, $requestPattern, $interceptor); } }