Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-30 18:01:41 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-30 18:01:41 +0300
commit424c2b826392eb010e07b01eca8e560681a09f6d (patch)
treebcaca336cff2222818985ebed0b6ca41a184e73e /lib
parent2ab503f70a507c6bc0d7652b223160fd5dad8041 (diff)
parent2660cf80c3232bd09030b70f55ce8bfbd6700b92 (diff)
Merge pull request #23652 from owncloud/stable9_23651
[Stable 9] 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 5e40acefbef..9e04d57b289 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);
}