From aaab9ead70afdab77284389def7b4c6e05c1f5b7 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 14 Dec 2021 11:42:34 +0100 Subject: [PATCH] feat: remove func permission models --- src/Appwrite/Utopia/Response.php | 2 - src/Appwrite/Utopia/Response/Model/Func.php | 8 ++-- .../Utopia/Response/Model/FuncPermissions.php | 42 ------------------- 3 files changed, 4 insertions(+), 48 deletions(-) delete mode 100644 src/Appwrite/Utopia/Response/Model/FuncPermissions.php diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 025e7d8e06..5c8bd722da 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -33,7 +33,6 @@ use Appwrite\Utopia\Response\Model\Execution; use Appwrite\Utopia\Response\Model\File; use Appwrite\Utopia\Response\Model\Func; use Appwrite\Utopia\Response\Model\Index; -use Appwrite\Utopia\Response\Model\FuncPermissions; use Appwrite\Utopia\Response\Model\JWT; use Appwrite\Utopia\Response\Model\Key; use Appwrite\Utopia\Response\Model\Language; @@ -244,7 +243,6 @@ class Response extends SwooleResponse ->setModel(new Membership()) ->setModel(new Func()) ->setModel(new Runtime()) - ->setModel(new FuncPermissions()) ->setModel(new Tag()) ->setModel(new Execution()) ->setModel(new Project()) diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index df0b35caef..f731438b09 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -17,10 +17,10 @@ class Func extends Model 'example' => '5e5ea5c16897e', ]) ->addRule('execute', [ - 'type' => Response::MODEL_FUNC_PERMISSIONS, - 'description' => 'Function permissions.', - 'default' => new \stdClass, - 'example' => new \stdClass, + 'type' => self::TYPE_STRING, + 'description' => 'Execution permissions.', + 'default' => '', + 'example' => 'role:member', 'array' => false, ]) ->addRule('name', [ diff --git a/src/Appwrite/Utopia/Response/Model/FuncPermissions.php b/src/Appwrite/Utopia/Response/Model/FuncPermissions.php deleted file mode 100644 index 22ee62b759..0000000000 --- a/src/Appwrite/Utopia/Response/Model/FuncPermissions.php +++ /dev/null @@ -1,42 +0,0 @@ -addRule('execute', [ - 'type' => self::TYPE_STRING, - 'description' => 'Execution permissions.', - 'default' => [], - 'example' => 'user:5e5ea5c16897e', - 'array' => true, - ]) - ; - } - - /** - * Get Name - * - * @return string - */ - public function getName():string - { - return 'FuncPermissions'; - } - - /** - * Get Collection - * - * @return string - */ - public function getType():string - { - return Response::MODEL_FUNC_PERMISSIONS; - } -}