Skip to content
Snippets Groups Projects
Commit 93eb73b0 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #18986 from owncloud/federated_capabilities

Expose federated sharing capabilities to authenticated users
parents 0c37a28a 91dfcab0
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,13 @@ class Capabilities implements ICapability {
$res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes';
//Federated sharing
$res['federation'] = [
'outgoing' => $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes',
'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes'
];
return [
'files_sharing' => $res,
];
......
......@@ -202,5 +202,40 @@ class FilesSharingCapabilitiesTest extends \Test\TestCase {
$this->assertFalse($result['public']['upload']);
}
public function testFederatedSharingIncomming() {
$map = [
['files_sharing', 'incoming_server2server_share_enabled', 'yes', 'yes'],
];
$result = $this->getResults($map);
$this->assertArrayHasKey('federation', $result);
$this->assertTrue($result['federation']['incoming']);
}
public function testFederatedSharingNoIncomming() {
$map = [
['files_sharing', 'incoming_server2server_share_enabled', 'yes', 'no'],
];
$result = $this->getResults($map);
$this->assertArrayHasKey('federation', $result);
$this->assertFalse($result['federation']['incoming']);
}
public function testFederatedSharingOutgoing() {
$map = [
['files_sharing', 'outgoing_server2server_share_enabled', 'yes', 'yes'],
];
$result = $this->getResults($map);
$this->assertArrayHasKey('federation', $result);
$this->assertTrue($result['federation']['outgoing']);
}
public function testFederatedSharingNoOutgoing() {
$map = [
['files_sharing', 'outgoing_server2server_share_enabled', 'yes', 'no'],
];
$result = $this->getResults($map);
$this->assertArrayHasKey('federation', $result);
$this->assertFalse($result['federation']['outgoing']);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment