diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-19 10:08:32 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-04-19 13:17:58 +0300 |
commit | 241dfab33f2703809565365c81b11c9f1c755632 (patch) | |
tree | 76470a567bb710eda6cb6c3f31828c3ae5047dd0 /apps/federatedfilesharing/tests | |
parent | 8c82dd37b4cd023e3a5b8ee492800134e4544f4a (diff) |
Do not allow adding file drop shares to your own cloud
There is no reason for this and you can't create such shares normally
anyway.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/federatedfilesharing/tests')
-rw-r--r-- | apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php index ca4bd1496f8..82980ee41f4 100644 --- a/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php +++ b/apps/federatedfilesharing/tests/Controller/MountPublicLinkControllerTest.php @@ -139,7 +139,8 @@ class MountPublicLinkControllerTest extends \Test\TestCase { $token, $validToken, $createSuccessful, - $expectedReturnData + $expectedReturnData, + $permissions ) { $this->federatedShareProvider->expects($this->any()) ->method('isOutgoingServer2serverShareEnabled') @@ -157,6 +158,7 @@ class MountPublicLinkControllerTest extends \Test\TestCase { ); $share = $this->share; + $share->setPermissions($permissions); $this->shareManager->expects($this->any())->method('getShareByToken') ->with($token) @@ -199,15 +201,16 @@ class MountPublicLinkControllerTest extends \Test\TestCase { public function dataTestCreateFederatedShare() { return [ //shareWith, outgoingSharesAllowed, validShareWith, token, validToken, createSuccessful, expectedReturnData - ['user@server', true, true, 'token', true, true, 'server'], - ['user@server', true, false, 'token', true, true, 'invalid federated cloud id'], - ['user@server', true, false, 'token', false, true, 'invalid federated cloud id'], - ['user@server', true, false, 'token', false, false, 'invalid federated cloud id'], - ['user@server', true, false, 'token', true, false, 'invalid federated cloud id'], - ['user@server', true, true, 'token', false, true, 'invalid token'], - ['user@server', true, true, 'token', false, false, 'invalid token'], - ['user@server', true, true, 'token', true, false, 'can not create share'], - ['user@server', false, true, 'token', true, true, 'This server doesn\'t support outgoing federated shares'], + ['user@server', true, true, 'token', true, true, 'server', 31], + ['user@server', true, true, 'token', false, false, 'server', 4], + ['user@server', true, false, 'token', true, true, 'invalid federated cloud id', 31], + ['user@server', true, false, 'token', false, true, 'invalid federated cloud id', 31], + ['user@server', true, false, 'token', false, false, 'invalid federated cloud id', 31], + ['user@server', true, false, 'token', true, false, 'invalid federated cloud id', 31], + ['user@server', true, true, 'token', false, true, 'invalid token', 31], + ['user@server', true, true, 'token', false, false, 'invalid token', 31], + ['user@server', true, true, 'token', true, false, 'can not create share', 31], + ['user@server', false, true, 'token', true, true, 'This server doesn\'t support outgoing federated shares', 31], ]; } } |