diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php index 0338dfe96e2..ea71c47a05c 100644 --- a/apps/files_sharing/lib/capabilities.php +++ b/apps/files_sharing/lib/capabilities.php @@ -59,6 +59,7 @@ class Capabilities implements ICapability { } $public['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') === 'yes'; + $public['upload'] = $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes'; } $res["public"] = $public; diff --git a/apps/files_sharing/tests/capabilities.php b/apps/files_sharing/tests/capabilities.php index 7656849120b..5b9789ce324 100644 --- a/apps/files_sharing/tests/capabilities.php +++ b/apps/files_sharing/tests/capabilities.php @@ -183,4 +183,24 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase { $result = $this->getResults($map); $this->assertFalse($result['resharing']); } + + public function testLinkPublicUpload() { + $map = [ + ['core', 'shareapi_allow_links', 'yes', 'yes'], + ['core', 'shareapi_allow_public_upload', 'yes', 'yes'], + ]; + $result = $this->getResults($map); + $this->assertTrue($result['public']['upload']); + } + + public function testLinkNoPublicUpload() { + $map = [ + ['core', 'shareapi_allow_links', 'yes', 'yes'], + ['core', 'shareapi_allow_public_upload', 'yes', 'no'], + ]; + $result = $this->getResults($map); + $this->assertFalse($result['public']['upload']); + } + + }