findInstanceWithRange($args['type'], $args['id']); if (!Authority::canIndexBookmarks($user = $this->getUser($request), $instance)) { throw new AuthorizationFailedException(); } $resources = $instance->getUsersBookmarks($user); $total = count($resources); list($offset, $limit) = $this->getOffsetAndLimit(); return $this->getPaginatedContentResponse(array_slice($resources, $offset, $limit), $total); } }