aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-05-27 11:05:31 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-06 09:55:59 +0200
commitbf5e9357fc5dacc0bc951e7c60fe7105533a56fb (patch)
treeb61d8f542b92dd11e1cffdd59bee90272482890c /lib/private
parenta66c2e6a4757b5d97e120897df1085e4410b279a (diff)
downloadnextcloud-server-bf5e9357fc5dacc0bc951e7c60fe7105533a56fb.tar.gz
nextcloud-server-bf5e9357fc5dacc0bc951e7c60fe7105533a56fb.zip
don't allow to share single files with delete permissions, user should only be possible to unshare a single file but never to delete it
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/share/share.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 2126a1d2dd4..10b3cc34467 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -519,6 +519,11 @@ class Share extends \OC\Share\Constants {
}
}
+ // single file shares should never have delete permissions
+ if ($itemType === 'file') {
+ $permissions = (int)$permissions & ~\OCP\PERMISSION_DELETE;
+ }
+
// Verify share type and sharing conditions are met
if ($shareType === self::SHARE_TYPE_USER) {
if ($shareWith == $uidOwner) {