Merge pull request #18986 from owncloud/federated_capabilities
Expose federated sharing capabilities to authenticated users
This commit is contained in:
commit
93eb73b0bb
|
@ -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']);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue