1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

Allows to update permissions without payload

This commit is contained in:
gepd 2022-06-06 18:27:05 -04:00 committed by GitHub
parent 619ff84f01
commit 8f831b2be3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1992,8 +1992,8 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId')
$data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array
if (empty($data)) {
throw new Exception('Missing payload', 400);
if (empty($data) && empty($read) && empty($write)) {
throw new Exception('Missing payload or read/write permissions', 400);
}
if (!\is_array($data)) {