diff options
author | Björn Schießle <schiessle@owncloud.com> | 2016-04-12 15:22:46 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2016-04-12 17:56:56 +0200 |
commit | 499d131a09dbef87a893f799c84c28abaa035c2e (patch) | |
tree | aa8434f7918fbbf523e3c909534a38cc85c28241 | |
parent | e9a9af3493caa7e839e18cda0c8ea2d8dd7bfd22 (diff) | |
download | nextcloud-server-499d131a09dbef87a893f799c84c28abaa035c2e.tar.gz nextcloud-server-499d131a09dbef87a893f799c84c28abaa035c2e.zip |
always return the complete permissions the file was shared with
-rw-r--r-- | apps/dav/lib/connector/sabre/node.php | 8 | ||||
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/node.php | 36 | ||||
-rw-r--r-- | build/integration/features/sharing-v1.feature | 4 |
3 files changed, 20 insertions, 28 deletions
diff --git a/apps/dav/lib/connector/sabre/node.php b/apps/dav/lib/connector/sabre/node.php index 9867fe66cd3..eaba6713992 100644 --- a/apps/dav/lib/connector/sabre/node.php +++ b/apps/dav/lib/connector/sabre/node.php @@ -246,14 +246,6 @@ abstract class Node implements \Sabre\DAV\INode { } /* - * Without sharing permissions there are also no other permissions - */ - if (!($permissions & \OCP\Constants::PERMISSION_SHARE) || - !($permissions & \OCP\Constants::PERMISSION_READ)) { - return 0; - } - - /* * Files can't have create or delete permissions */ if ($this->info->getType() === \OCP\Files\FileInfo::TYPE_FILE) { diff --git a/apps/dav/tests/unit/connector/sabre/node.php b/apps/dav/tests/unit/connector/sabre/node.php index cde8e746dc3..6fdf77adc21 100644 --- a/apps/dav/tests/unit/connector/sabre/node.php +++ b/apps/dav/tests/unit/connector/sabre/node.php @@ -66,14 +66,14 @@ class Node extends \Test\TestCase { public function sharePermissionsProvider() { return [ - [\OCP\Files\FileInfo::TYPE_FILE, 1, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 3, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 5, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 7, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 9, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 11, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 13, 0], - [\OCP\Files\FileInfo::TYPE_FILE, 15, 0], + [\OCP\Files\FileInfo::TYPE_FILE, 1, 1], + [\OCP\Files\FileInfo::TYPE_FILE, 3, 3], + [\OCP\Files\FileInfo::TYPE_FILE, 5, 1], + [\OCP\Files\FileInfo::TYPE_FILE, 7, 3], + [\OCP\Files\FileInfo::TYPE_FILE, 9, 1], + [\OCP\Files\FileInfo::TYPE_FILE, 11, 3], + [\OCP\Files\FileInfo::TYPE_FILE, 13, 1], + [\OCP\Files\FileInfo::TYPE_FILE, 15, 3], [\OCP\Files\FileInfo::TYPE_FILE, 17, 17], [\OCP\Files\FileInfo::TYPE_FILE, 19, 19], [\OCP\Files\FileInfo::TYPE_FILE, 21, 17], @@ -81,16 +81,16 @@ class Node extends \Test\TestCase { [\OCP\Files\FileInfo::TYPE_FILE, 25, 17], [\OCP\Files\FileInfo::TYPE_FILE, 27, 19], [\OCP\Files\FileInfo::TYPE_FILE, 29, 17], - [\OCP\Files\FileInfo::TYPE_FILE, 30, 0], + [\OCP\Files\FileInfo::TYPE_FILE, 30, 18], [\OCP\Files\FileInfo::TYPE_FILE, 31, 19], - [\OCP\Files\FileInfo::TYPE_FOLDER, 1, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 3, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 5, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 7, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 9, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 11, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 13, 0], - [\OCP\Files\FileInfo::TYPE_FOLDER, 15, 0], + [\OCP\Files\FileInfo::TYPE_FOLDER, 1, 1], + [\OCP\Files\FileInfo::TYPE_FOLDER, 3, 3], + [\OCP\Files\FileInfo::TYPE_FOLDER, 5, 5], + [\OCP\Files\FileInfo::TYPE_FOLDER, 7, 7], + [\OCP\Files\FileInfo::TYPE_FOLDER, 9, 9], + [\OCP\Files\FileInfo::TYPE_FOLDER, 11, 11], + [\OCP\Files\FileInfo::TYPE_FOLDER, 13, 13], + [\OCP\Files\FileInfo::TYPE_FOLDER, 15, 15], [\OCP\Files\FileInfo::TYPE_FOLDER, 17, 17], [\OCP\Files\FileInfo::TYPE_FOLDER, 19, 19], [\OCP\Files\FileInfo::TYPE_FOLDER, 21, 21], @@ -98,7 +98,7 @@ class Node extends \Test\TestCase { [\OCP\Files\FileInfo::TYPE_FOLDER, 25, 25], [\OCP\Files\FileInfo::TYPE_FOLDER, 27, 27], [\OCP\Files\FileInfo::TYPE_FOLDER, 29, 29], - [\OCP\Files\FileInfo::TYPE_FOLDER, 30, 0], + [\OCP\Files\FileInfo::TYPE_FOLDER, 30, 30], [\OCP\Files\FileInfo::TYPE_FOLDER, 31, 31], ]; } diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index b9d77120b9c..83b72cc7449 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -593,7 +593,7 @@ Feature: sharing | permissions | 3 | When as "user1" gets properties of folder "/tmp.txt" with |{http://owncloud.org/ns}share-permissions| - Then the single response should contain a property "{http://owncloud.org/ns}share-permissions" with value "0" + Then the single response should contain a property "{http://owncloud.org/ns}share-permissions" with value "3" Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions Given user "user0" exists @@ -669,4 +669,4 @@ Feature: sharing | permissions | 15 | When as "user1" gets properties of folder "/tmp" with |{http://owncloud.org/ns}share-permissions| - Then the single response should contain a property "{http://owncloud.org/ns}share-permissions" with value "0" + Then the single response should contain a property "{http://owncloud.org/ns}share-permissions" with value "15" |