/**
  * @return void
  */
 public function initialize()
 {
     if ($this->initialized) {
         return;
     }
     $this->initialized = true;
     $this->nodeContext = new $this->nodeContextClassName();
     $eelContext = new Context($this->nodeContext);
     $this->eelCompilingEvaluator = new CompilingEvaluator();
     $this->eelCompilingEvaluator->evaluate($this->getParsedMatcher(), $eelContext);
     $methodPrivilegeMatcher = $this->buildMethodPrivilegeMatcher();
     $methodPrivilegeTarget = new PrivilegeTarget($this->privilegeTarget->getIdentifier() . '__methodPrivilege', '\\TYPO3\\Flow\\Security\\Authorization\\Privilege\\Method\\MethodPrivilege', $methodPrivilegeMatcher);
     $methodPrivilegeTarget->injectObjectManager($this->objectManager);
     $this->methodPrivilege = $methodPrivilegeTarget->createPrivilege($this->getPermission(), $this->getParameters());
 }
 /**
  * Initialized all configured privilege targets from the policy definitions
  *
  * @return void
  * @throws SecurityException
  */
 protected function initializePrivilegeTargets()
 {
     if (!isset($this->policyConfiguration['privilegeTargets'])) {
         return;
     }
     foreach ($this->policyConfiguration['privilegeTargets'] as $privilegeClassName => $privilegeTargetsConfiguration) {
         foreach ($privilegeTargetsConfiguration as $privilegeTargetIdentifier => $privilegeTargetConfiguration) {
             if (!isset($privilegeTargetConfiguration['matcher'])) {
                 throw new SecurityException(sprintf('No "matcher" configured for privilegeTarget "%s"', $privilegeTargetIdentifier), 1401795388);
             }
             $parameterDefinitions = array();
             $privilegeParameterConfiguration = isset($privilegeTargetConfiguration['parameters']) ? $privilegeTargetConfiguration['parameters'] : array();
             foreach ($privilegeParameterConfiguration as $parameterName => $parameterValue) {
                 if (!isset($privilegeTargetConfiguration['parameters'][$parameterName])) {
                     throw new SecurityException(sprintf('No parameter definition found for parameter "%s" in privilegeTarget "%s"', $parameterName, $privilegeTargetIdentifier), 1395869330);
                 }
                 if (!isset($privilegeTargetConfiguration['parameters'][$parameterName]['className'])) {
                     throw new SecurityException(sprintf('No "className" defined for parameter "%s" in privilegeTarget "%s"', $parameterName, $privilegeTargetIdentifier), 1396021782);
                 }
                 $parameterDefinitions[$parameterName] = new PrivilegeParameterDefinition($parameterName, $privilegeTargetConfiguration['parameters'][$parameterName]['className']);
             }
             $privilegeTarget = new PrivilegeTarget($privilegeTargetIdentifier, $privilegeClassName, $privilegeTargetConfiguration['matcher'], $parameterDefinitions);
             $privilegeTarget->injectObjectManager($this->objectManager);
             $this->privilegeTargets[$privilegeTargetIdentifier] = $privilegeTarget;
         }
     }
 }