diff --git a/Controller/Thread.php b/Controller/Thread.php index 38934ee21..4385c5c5c 100755 --- a/Controller/Thread.php +++ b/Controller/Thread.php @@ -253,12 +253,10 @@ public function threadXHR(Request $request) $content = json_decode($request->getContent(), true); $em = $this->getDoctrine()->getManager(); - $ticket = $entityManager->getRepository('UVDeskCoreFrameworkBundle:Ticket')->findOneById($content['ticketId']); - $user = $this->userService->getSessionUser(); + $ticket = $em->getRepository('UVDeskCoreFrameworkBundle:Ticket')->findOneById($content['ticketId']); // Proceed only if user has access to the resource - if ( (!$this->userService->getSessionUser()) || (false == $this->ticketService->isTicketAccessGranted($ticket, $user)) ) - { + if (false == $this->ticketService->isTicketAccessGranted($ticket)){ throw new \Exception('Access Denied', 403); }