summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-23 15:43:21 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-24 09:48:48 +0200
commit2ca13014943858e22daa20c7147121f47f1fed00 (patch)
tree3c7d63791490f9311044c7370f234388baba9fff /lib
parentdc78d26f2abec23e68b5dd3011f698d7b9f6e6a3 (diff)
downloadnextcloud-server-2ca13014943858e22daa20c7147121f47f1fed00.tar.gz
nextcloud-server-2ca13014943858e22daa20c7147121f47f1fed00.zip
Add explicit delete permission to link shares
Link shares always allowed deletion, however internally the permissions were stored as 7 which lacked delete permissions. This created an inconsistency in the Webdav permissions. This fix makes sure we include delete permissions in the share permissions, which now become 15. In case a client is still passing 7 for legacy reasons, it gets converted automatically to 15.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index e2730f4d5fb..2c08e616f82 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -446,14 +446,9 @@ class Manager implements IManager {
throw new \InvalidArgumentException('Link shares can\'t have reshare permissions');
}
- // We don't allow deletion on link shares
- if ($share->getPermissions() & \OCP\Constants::PERMISSION_DELETE) {
- throw new \InvalidArgumentException('Link shares can\'t have delete permissions');
- }
-
// Check if public upload is allowed
if (!$this->shareApiLinkAllowPublicUpload() &&
- ($share->getPermissions() & (\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE))) {
+ ($share->getPermissions() & (\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE))) {
throw new \InvalidArgumentException('Public upload not allowed');
}
}