]> source.dussan.org Git - nextcloud-server.git/commitdiff
update permissions
authorBjoern Schiessle <bjoern@schiessle.org>
Wed, 5 Oct 2016 15:51:43 +0000 (17:51 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Tue, 1 Nov 2016 18:51:11 +0000 (19:51 +0100)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
apps/files/lib/Controller/ApiController.php
apps/files_sharing/lib/Controller/ShareAPIController.php

index d6f88581b9621a5ea5d2d6f140d0ab9186e8dd9c..138b68601cb7b43e070a59e9d7647b74b989e5c5 100644 (file)
@@ -200,7 +200,8 @@ class ApiController extends Controller {
                        \OCP\Share::SHARE_TYPE_USER,
                        \OCP\Share::SHARE_TYPE_GROUP,
                        \OCP\Share::SHARE_TYPE_LINK,
-                       \OCP\Share::SHARE_TYPE_REMOTE
+                       \OCP\Share::SHARE_TYPE_REMOTE,
+                       \OCP\Share::SHARE_TYPE_EMAIL
                ];
                foreach ($requestedShareTypes as $requestedShareType) {
                        // one of each type is enough to find out about the types
index ef22b473189565e21ae6d035db769b090f89d114..f9c7d69cf5f04200c1044fba91b295f837bc2a05 100644 (file)
@@ -405,7 +405,14 @@ class ShareAPIController extends OCSController {
                        $share->setSharedWith($shareWith);
                        $share->setPermissions($permissions);
                } else if ($shareType === \OCP\Share::SHARE_TYPE_EMAIL) {
-                       $share->setPermissions(\OCP\Constants::PERMISSION_READ);
+                       if ($share->getNodeType() === 'file') {
+                               $share->setPermissions(\OCP\Constants::PERMISSION_READ);
+                       } else {
+                               $share->setPermissions(
+                                       \OCP\Constants::PERMISSION_READ |
+                                       \OCP\Constants::PERMISSION_CREATE |
+                                       \OCP\Constants::PERMISSION_UPDATE);
+                       }
                        $share->setSharedWith($shareWith);
                } else {
                        throw new OCSBadRequestException($this->l->t('Unknown share type'));