Changed execution default permissions

This commit is contained in:
Eldad Fux
2021-03-14 01:52:05 +02:00
parent bfaf670b4e
commit 024fae0d21
3 changed files with 11 additions and 4 deletions
+7
View File
@@ -1,7 +1,14 @@
# Version 0.8.0 (Not Released Yet)
## Features
- Anonymous login
## Breaking Changes
- Only logged in users can execute functions (for guests, use anonymous login)
- Only the user who has triggered the execution get access to the relevant execution logs
# Version 0.7.1
## Features
-2
View File
@@ -60,8 +60,6 @@ return [
'files.read',
'locale.read',
'avatars.read',
'execution.read',
'execution.write',
],
],
Auth::USER_ROLE_MEMBER => [
+4 -2
View File
@@ -676,10 +676,12 @@ App::post('/v1/functions/:functionId/executions')
->inject('response')
->inject('project')
->inject('projectDB')
->action(function ($functionId, /*$async,*/ $response, $project, $projectDB) {
->inject('user')
->action(function ($functionId, /*$async,*/ $response, $project, $projectDB, $user) {
/** @var Appwrite\Utopia\Response $response */
/** @var Appwrite\Database\Document $project */
/** @var Appwrite\Database\Database $projectDB */
/** @var Appwrite\Database\Document $user */
Authorization::disable();
@@ -712,7 +714,7 @@ App::post('/v1/functions/:functionId/executions')
$execution = $projectDB->createDocument([
'$collection' => Database::SYSTEM_COLLECTION_EXECUTIONS,
'$permissions' => [
'read' => $function->getPermissions()['execute'] ?? [],
'read' => (!empty($user->getId())) ? ['user:' . $user->getId()] : [],
'write' => [],
],
'dateCreated' => time(),