/**
  * Adds a NotEmptyValidator to the current element if the "trigger" value is not empty.
  * The trigger can be configured with $this->properties['triggerPropertyPath']
  *
  * @param \TYPO3\Form\Core\Runtime\FormRuntime $formRuntime
  * @return void
  */
 protected function requireIfTriggerIsSet(\TYPO3\Form\Core\Runtime\FormRuntime $formRuntime)
 {
     if ($formRuntime->getRequest()->getParentRequest()->getControllerActionName() == 'newDataSheet') {
         if ($this->authenticationManager->isAuthenticated() && $this->authenticationManager->getSecurityContext()->hasRole('GIB.GradingTool:Administrator')) {
             $this->addValidator(new \TYPO3\Flow\Validation\Validator\NotEmptyValidator());
         } elseif (!$this->authenticationManager->isAuthenticated()) {
             $this->addValidator(new \TYPO3\Flow\Validation\Validator\NotEmptyValidator());
         } else {
             return;
         }
     } elseif ($formRuntime->getRequest()->getParentRequest()->getControllerActionName() == 'editDataSheet') {
         return;
     }
 }