1
0
Fork 0
mirror of synced 2024-09-29 08:51:28 +13:00

Merge pull request #1109 from TorstenDittmann/fix-executions-permissions

fix: executions permission validation
This commit is contained in:
Eldad A. Fux 2021-04-28 11:59:33 +03:00 committed by GitHub
commit cffa50f272
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -802,7 +802,9 @@ App::get('/v1/functions/:functionId/executions')
/** @var Appwrite\Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
Authorization::disable();
$function = $projectDB->getDocument($functionId);
Authorization::reset();
if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) {
throw new Exception('Function not found', 404);
@ -844,7 +846,9 @@ App::get('/v1/functions/:functionId/executions/:executionId')
/** @var Appwrite\Utopia\Response $response */
/** @var Appwrite\Database\Database $projectDB */
Authorization::disable();
$function = $projectDB->getDocument($functionId);
Authorization::reset();
if (empty($function->getId()) || Database::SYSTEM_COLLECTION_FUNCTIONS != $function->getCollection()) {
throw new Exception('Function not found', 404);