Beispiel #1
0
 /**
  * @return Account
  */
 public function getCreator()
 {
     $account = $this->payload->getAccount();
     if ($account !== NULL) {
         return $this->objectManager->get(Account::class, $account);
     } else {
         return NULL;
     }
 }
 /**
  * @param Session $session
  */
 public function deleteAction(Session $session)
 {
     if ($session->getAccount() !== $this->securityContext->getAccount() && !$this->securityContext->hasRole('T3DD.Backend:Administrator')) {
         $this->response->setStatus(403);
         return;
     }
     foreach ($this->voteRepository->findBySession($session) as $vote) {
         $this->voteRepository->remove($vote);
     }
     $this->sessionRepository->remove($session);
     // TODO Fix redirect
     $this->redirect('index');
 }