summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-30 16:56:23 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-30 16:56:23 +0200
commit7d7a595969a70be2afe857eb5cedd16dfc999e0c (patch)
tree15ea95aecc0b12b3b8a56ea45e38d9c05912968b /lib
parent0e687993c8afb36876e7d90c229b97b4aaf43b70 (diff)
parent9ce5e4b01fcc8bf1805e97e162dd28bba3a7d251 (diff)
downloadnextcloud-server-7d7a595969a70be2afe857eb5cedd16dfc999e0c.tar.gz
nextcloud-server-7d7a595969a70be2afe857eb5cedd16dfc999e0c.zip
Merge pull request #23651 from owncloud/fix_23536
Non moveable mount points should always be UPDATE+DELETE shareable
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 4737de002cb..1c9d4d82277 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -23,6 +23,7 @@
namespace OC\Share20;
+use OC\Files\Mount\MoveableMount;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IUserManager;
@@ -215,8 +216,19 @@ class Manager implements IManager {
throw new \InvalidArgumentException('A share requires permissions');
}
+ /*
+ * Quick fix for #23536
+ * Non moveable mount points do not have update and delete permissions
+ * while we 'most likely' do have that on the storage.
+ */
+ $permissions = $share->getNode()->getPermissions();
+ $mount = $share->getNode()->getMountPoint();
+ if (!($mount instanceof MoveableMount)) {
+ $permissions |= \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE;
+ }
+
// Check that we do not share with more permissions than we have
- if ($share->getPermissions() & ~$share->getNode()->getPermissions()) {
+ if ($share->getPermissions() & ~$permissions) {
$message_t = $this->l->t('Cannot increase permissions of %s', [$share->getNode()->getPath()]);
throw new GenericShareException($message_t, $message_t, 404);
}