Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch '1.0'
  • Loading branch information
Sanjeev Papnoi committed Aug 10, 2021
2 parents a798acb + 3ebe941 commit 361b8c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Controller/Thread.php
Expand Up @@ -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);
}

Expand Down

0 comments on commit 361b8c3

Please sign in to comment.