From 5ae185a8b1427a5daa7bb98499482d4c33f6be29 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Thu, 25 Aug 2022 14:47:25 +0200 Subject: Add bulkupload.enabled configuration switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/dav/lib/Capabilities.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/Capabilities.php b/apps/dav/lib/Capabilities.php index 41d1b983587..fd500ee8012 100644 --- a/apps/dav/lib/Capabilities.php +++ b/apps/dav/lib/Capabilities.php @@ -4,6 +4,7 @@ * * @author Thomas Müller * @author Louis Chemineau + * @author Côme Chilliet * * @license AGPL-3.0 * @@ -23,15 +24,24 @@ namespace OCA\DAV; use OCP\Capabilities\ICapability; +use OCP\IConfig; class Capabilities implements ICapability { + private IConfig $config; + + public function __construct(IConfig $config) { + $this->config = $config; + } + public function getCapabilities() { - return [ + $capabilities = [ 'dav' => [ 'chunking' => '1.0', - // disabled because of https://github.com/nextcloud/desktop/issues/4243 - // 'bulkupload' => '1.0', ] ]; + if ($this->config->getSystemValueBool('bulkupload.enabled', false)) { + $capabilities['dav']['bulkupload'] = '1.0'; + } + return $capabilities; } } -- cgit v1.2.3