/**
  * @param Mirasvit_Helpdesk_Model_Ticket $ticket
  */
 public function checkReadTicketRestrictions($ticket)
 {
     $allow = false;
     if ($permission = $this->getPermission()) {
         $departmentIds = $permission->getDepartmentIds();
         if (in_array(0, $departmentIds)) {
             $allow = true;
         } else {
             if (in_array($ticket->getDepartmentId(), $departmentIds)) {
                 $allow = true;
             }
         }
     }
     if (!$allow) {
         echo $this->__('You don\'t have permissions to read this ticket. Please, contact your administrator.');
         die;
     }
 }