canVisitElement($resource)) { throw new AuthorizationFailedException(); } $descendants = $resource->findDescendants(); [$offset, $limit] = $this->getOffsetAndLimit(); $page = array_slice($descendants, $offset, $limit); $total = count($descendants); return $this->getPaginatedContentResponse( $page, $total ); } }