diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-14 20:00:04 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-08-14 20:03:32 +0200 |
commit | dce5d9b5d1b7e43ac2d9c48f84220a89c3d93015 (patch) | |
tree | f2e294fc270e8b857fcf6d4ffa387a4003ab54f8 /apps/files_sharing | |
parent | ddc7f668e59223d95cb42e4f0281d5dab5888d79 (diff) | |
download | nextcloud-server-dce5d9b5d1b7e43ac2d9c48f84220a89c3d93015.tar.gz nextcloud-server-dce5d9b5d1b7e43ac2d9c48f84220a89c3d93015.zip |
Add public upload to capability
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/capabilities.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/tests/capabilities.php | 20 |
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']); + } + + } |