fix: collection level permissions cursor
This commit is contained in:
parent
bb208fd05c
commit
8122d8882b
|
@ -1728,7 +1728,9 @@ App::get('/v1/database/collections/:collectionId/documents')
|
|||
|
||||
$cursorDocument = null;
|
||||
if (!empty($cursor)) {
|
||||
$cursorDocument = $dbForProject->getDocument('collection_' . $collectionId, $cursor);
|
||||
$cursorDocument = $collection->getAttribute('permission') === 'collection'
|
||||
? Authorization::skip(fn () => $dbForProject->getDocument('collection_' . $collectionId, $cursor))
|
||||
: $dbForProject->getDocument('collection_' . $collectionId, $cursor);
|
||||
|
||||
if ($cursorDocument->isEmpty()) {
|
||||
throw new Exception("Document '{$cursor}' for the 'cursor' value not found.", 400);
|
||||
|
|
Loading…
Reference in a new issue