/**
  * Check if an administrator is logged in or the owner of a project and deny access if someone else is trying to access
  *
  * @param \GIB\GradingTool\Domain\Model\Project $project
  */
 public function checkOwnerOrAdministratorAndDenyIfNeeded(\GIB\GradingTool\Domain\Model\Project $project)
 {
     // check if the user has access to this project
     if ($this->securityContext->getParty() !== $project->getProjectManager() && !array_key_exists('GIB.GradingTool:Administrator', $this->securityContext->getRoles())) {
         // add a flash message
         $message = new \TYPO3\Flow\Error\Message('Access denied.', \TYPO3\Flow\Error\Message::SEVERITY_ERROR);
         $this->flashMessageContainer->addMessage($message);
         $this->redirect('index', 'Standard');
     }
 }