getUser($request)) { throw new RecordNotFoundException(); } if (!Authority::canIndexNewsOfUser($observedUser, $this->getUser($request))) { throw new AuthorizationFailedException(); } $news = \StudipNews::GetNewsByAuthor($observedUser->user_id, true); list($offset, $limit) = $this->getOffsetAndLimit(); return $this->getPaginatedContentResponse( array_slice($news, $offset, $limit), count($news) ); } }