1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

fix: collection level permissions cursor

This commit is contained in:
Torsten Dittmann 2021-12-27 18:00:52 +01:00
parent bb208fd05c
commit 8122d8882b

View file

@ -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);