summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-17 11:35:31 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-03-17 13:56:51 +0100
commit52eb26dc9eedcd2d7a205210c306dcefcfcf41ae (patch)
tree9851f9b658c7561800a3a06b5fcb57e7136aa99f /apps
parent954a0a2dd56642ff8b1212601de572193e6e2b4e (diff)
downloadnextcloud-server-52eb26dc9eedcd2d7a205210c306dcefcfcf41ae.tar.gz
nextcloud-server-52eb26dc9eedcd2d7a205210c306dcefcfcf41ae.zip
Set proper public webdav permissions when public upload disabled
Fixes #23325 It can happen that a user shares a folder with public upload. And some time later the admin disables public upload on the server. To make sure this is handled correctly we need to check the config value and reduce the permissions. Fix is kept small to be easy backportable.
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/connector/publicauth.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/connector/publicauth.php b/apps/files_sharing/lib/connector/publicauth.php
index 9d1bf391560..31947632c46 100644
--- a/apps/files_sharing/lib/connector/publicauth.php
+++ b/apps/files_sharing/lib/connector/publicauth.php
@@ -60,6 +60,11 @@ class PublicAuth extends \Sabre\DAV\Auth\Backend\AbstractBasic {
return false;
}
+ if ((int)$linkItem['share_type'] === \OCP\Share::SHARE_TYPE_LINK &&
+ $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') !== 'yes') {
+ $this->share['permissions'] &= ~(\OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE);
+ }
+
// check if the share is password protected
if (isset($linkItem['share_with'])) {
if ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_LINK) {