diff --git a/app/views/console/functions/function.phtml b/app/views/console/functions/function.phtml index 405fd28eb0..0ec16db908 100644 --- a/app/views/console/functions/function.phtml +++ b/app/views/console/functions/function.phtml @@ -452,7 +452,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true); - +
Add * for wildcard access
diff --git a/app/workers/database.php b/app/workers/database.php index 42df89e1b5..60c060ee7a 100644 --- a/app/workers/database.php +++ b/app/workers/database.php @@ -3,6 +3,7 @@ use Appwrite\Resque\Worker; use Utopia\CLI\Console; use Utopia\Database\Document; +use Utopia\Database\Validator\Authorization; require_once __DIR__.'/../workers.php'; @@ -21,6 +22,8 @@ class DatabaseV1 extends Worker { $projectId = $this->args['projectId'] ?? ''; $type = $this->args['type'] ?? ''; + + Authorization::disable(); switch (strval($type)) { case CREATE_TYPE_ATTRIBUTE: @@ -49,6 +52,7 @@ class DatabaseV1 extends Worker break; } + Authorization::reset(); } public function shutdown(): void diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index 6d5bf8c01a..6c1ba151f6 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -16,12 +16,12 @@ class Func extends Model 'default' => '', 'example' => '5e5ea5c16897e', ]) - ->addRule('$permissions', [ - 'type' => Response::MODEL_PERMISSIONS, - 'description' => 'Function permissions.', - 'default' => new \stdClass, - 'example' => new \stdClass, - 'array' => false, + ->addRule('execute', [ + 'type' => self::TYPE_STRING, + 'description' => 'Document execute permissions.', + 'default' => '', + 'example' => 'role:all', + 'array' => true, ]) ->addRule('name', [ 'type' => self::TYPE_STRING,