From 0e8645fc1391c9a1f21206041a11f1ad46628801 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 22 Oct 2021 16:17:38 +0545 Subject: [PATCH 1/3] fix function model permission --- src/Appwrite/Utopia/Response.php | 3 ++ src/Appwrite/Utopia/Response/Model/Func.php | 2 +- .../Utopia/Response/Model/FuncPermissions.php | 42 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/Appwrite/Utopia/Response/Model/FuncPermissions.php diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 6a9f62cc4c..4f561de342 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -22,6 +22,7 @@ use Appwrite\Utopia\Response\Model\ErrorDev; use Appwrite\Utopia\Response\Model\Execution; use Appwrite\Utopia\Response\Model\File; use Appwrite\Utopia\Response\Model\Func; +use Appwrite\Utopia\Response\Model\FuncPermissions; use Appwrite\Utopia\Response\Model\JWT; use Appwrite\Utopia\Response\Model\Key; use Appwrite\Utopia\Response\Model\Language; @@ -106,6 +107,7 @@ class Response extends SwooleResponse const MODEL_TAG_LIST = 'tagList'; const MODEL_EXECUTION = 'execution'; const MODEL_EXECUTION_LIST = 'executionList'; + const MODEL_FUNC_PERMISSIONS = 'funcPermissions'; // Project const MODEL_PROJECT = 'project'; @@ -186,6 +188,7 @@ class Response extends SwooleResponse ->setModel(new Team()) ->setModel(new Membership()) ->setModel(new Func()) + ->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 cb869a6b5f..1ea91757c3 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -17,7 +17,7 @@ class Func extends Model 'example' => '5e5ea5c16897e', ]) ->addRule('$permissions', [ - 'type' => Response::MODEL_PERMISSIONS, + 'type' => Response::MODEL_FUNC_PERMISSIONS, 'description' => 'Function permissions.', 'default' => new \stdClass, 'example' => new \stdClass, diff --git a/src/Appwrite/Utopia/Response/Model/FuncPermissions.php b/src/Appwrite/Utopia/Response/Model/FuncPermissions.php new file mode 100644 index 0000000000..22ee62b759 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/FuncPermissions.php @@ -0,0 +1,42 @@ +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; + } +} From b7907a68cc45a2c8ad0e837b6886eaa39c0155ae Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 16 Nov 2021 14:33:59 +0000 Subject: [PATCH 2/3] Fix description for the update email endpoint --- docs/references/account/update-email.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/references/account/update-email.md b/docs/references/account/update-email.md index 7be36b7cdf..4a4fd16c04 100644 --- a/docs/references/account/update-email.md +++ b/docs/references/account/update-email.md @@ -1,2 +1,2 @@ -Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request. +Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however and you will need to use the send confirmation email endpoint again. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. \ No newline at end of file From 55c2759e9f52af212016abddf719ccdcd919fde6 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Fri, 19 Nov 2021 15:45:14 +0000 Subject: [PATCH 3/3] Update update-email.md --- docs/references/account/update-email.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/references/account/update-email.md b/docs/references/account/update-email.md index 4a4fd16c04..110ca8ee48 100644 --- a/docs/references/account/update-email.md +++ b/docs/references/account/update-email.md @@ -1,2 +1,2 @@ -Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however and you will need to use the send confirmation email endpoint again. For security measures, user password is required to complete this request. -This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. \ No newline at end of file +Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. +This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.