diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-25 10:30:03 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-25 12:19:38 +0100 |
commit | 0c9c7737b4b03f17af957b5036c143351a445a1b (patch) | |
tree | 3295e8e8d1710feca3c6c9c573f4faa76e1b2998 /apps/files_sharing/api/share20ocs.php | |
parent | 32f4bea0ae174487fd5a58e2c9eeb6e567d1ff91 (diff) | |
download | nextcloud-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.php | 9 |
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'); |