Add public upload to capability

This commit is contained in:
Roeland Jago Douma 2015-08-14 20:00:04 +02:00
parent ddc7f668e5
commit dce5d9b5d1
2 changed files with 21 additions and 0 deletions

View file

@ -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;

View file

@ -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']);
}
}