'any', 'requestData' => [ 'ticketNumber' => [ 'validation' => DataValidator::validTicketNumber(), 'error' => ERRORS::INVALID_TICKET ] ] ]; } public function handler() { $this->ticket = Ticket::getByTicketNumber(Controller::request('ticketNumber')); if ($this->shouldDenyPermission()) { throw new RequestException(ERRORS::NO_PERMISSION); } else { Response::respondSuccess($this->ticket->toArray()); } } private function shouldDenyPermission() { $user = Controller::getLoggedUser(); return !$user->canManageTicket($this->ticket); } }