summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-08-14 21:01:41 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-08-14 21:01:41 +0200
commit184b4e7d19ca8bdb7e94a58b7bcb808c147a7f27 (patch)
tree026b90854a67055d8a204fbe41f3e59948ac7f1f
parent72f829eb06a5ccc8e0defed1c4aa13695b7a009f (diff)
parentdce5d9b5d1b7e43ac2d9c48f84220a89c3d93015 (diff)
downloadnextcloud-server-184b4e7d19ca8bdb7e94a58b7bcb808c147a7f27.tar.gz
nextcloud-server-184b4e7d19ca8bdb7e94a58b7bcb808c147a7f27.zip
Merge pull request #18320 from owncloud/public_upload_capability
Add public upload to capability
-rw-r--r--apps/files_sharing/lib/capabilities.php1
-rw-r--r--apps/files_sharing/tests/capabilities.php20
2 files changed, 21 insertions, 0 deletions
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']);
+ }
+
+
}