]> source.dussan.org Git - nextcloud-server.git/commitdiff
Return correct error message on share download without read permission 23696/head
authorMorris Jobke <hey@morrisjobke.de>
Mon, 26 Oct 2020 15:22:27 +0000 (16:22 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Mon, 26 Oct 2020 15:22:27 +0000 (16:22 +0100)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
apps/files_sharing/lib/Controller/ShareController.php
apps/files_sharing/tests/Controller/ShareControllerTest.php

index fdf69abd9ac190a430969260b64d6318084fb43d..3e514b3a74d370cc755a2e7d6cadabc2635c7277 100644 (file)
@@ -556,7 +556,7 @@ class ShareController extends AuthPublicShareController {
                $share = $this->shareManager->getShareByToken($token);
 
                if (!($share->getPermissions() & \OCP\Constants::PERMISSION_READ)) {
-                       return new \OCP\AppFramework\Http\DataResponse('Share is read-only');
+                       return new \OCP\AppFramework\Http\DataResponse('Share has no read permission');
                }
 
                $files_list = null;
index 33dff13cafeaa3b415f9b15de276ee8ab1af8eaf..270f38a1148993f4d3581ad6928babc002f0a4bf 100644 (file)
@@ -840,7 +840,7 @@ class ShareControllerTest extends \Test\TestCase {
 
                // Test with a password protected share and no authentication
                $response = $this->shareController->downloadShare('validtoken');
-               $expectedResponse = new DataResponse('Share is read-only');
+               $expectedResponse = new DataResponse('Share has no read permission');
                $this->assertEquals($expectedResponse, $response);
        }