From 3ebe941859b29e5cbc633f4cd31d4e07bdb140ec Mon Sep 17 00:00:00 2001 From: Sanjeev Papnoi Date: Tue, 10 Aug 2021 16:10:23 +0530 Subject: [PATCH] updates --- Controller/Thread.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); }