TicketFollowup::canViewItem PHP Method

canViewItem() public method

Is the current user have right to show the current followup ?
public canViewItem ( ) : boolean
return boolean
    function canViewItem()
    {
        $ticket = new Ticket();
        if (!$ticket->can($this->getField('tickets_id'), READ)) {
            return false;
        }
        if (Session::haveRight(self::$rightname, self::SEEPRIVATE)) {
            return true;
        }
        if (!$this->fields['is_private'] && Session::haveRight(self::$rightname, self::SEEPUBLIC)) {
            return true;
        }
        if ($this->fields["users_id"] === Session::getLoginUserID()) {
            return true;
        }
        return false;
    }