summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api/share20ocs.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-25 10:30:03 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-25 12:19:38 +0100
commit0c9c7737b4b03f17af957b5036c143351a445a1b (patch)
tree3295e8e8d1710feca3c6c9c573f4faa76e1b2998 /apps/files_sharing/api/share20ocs.php
parent32f4bea0ae174487fd5a58e2c9eeb6e567d1ff91 (diff)
downloadnextcloud-server-0c9c7737b4b03f17af957b5036c143351a445a1b.tar.gz
nextcloud-server-0c9c7737b4b03f17af957b5036c143351a445a1b.zip
Remove delete permissions for read-only federated reshares
An incomming federated share is just a mount point. Therefor if we request the permissions on the mountpoint DELETE permissions will be returned (among others). Since we can always remove a mountpoint, update a mount point. However now when trying to reshare we will try to reshare with DELETE permissions. Which is false. This PR removes the delete permissions if it is a shared storage. Basically a quick hack. Fixes #22587
Diffstat (limited to 'apps/files_sharing/api/share20ocs.php')
-rw-r--r--apps/files_sharing/api/share20ocs.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index 309e1159fff..588538fbb6c 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -271,6 +271,15 @@ class Share20OCS {
$permissions &= ~\OCP\Constants::PERMISSION_CREATE;
}
+ /*
+ * Hack for https://github.com/owncloud/core/issues/22587
+ * We check the permissions via webdav. But the permissions of the mount point
+ * do not equal the share permissions. Here we fix that for federated mounts.
+ */
+ if ($path->getStorage()->instanceOfStorage('OCA\Files_Sharing\External\Storage')) {
+ $permissions &= ~($permissions & ~$path->getPermissions());
+ }
+
$shareWith = $this->request->getParam('shareWith', null);
$shareType = (int)$this->request->getParam('shareType', '-1');