diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-03-30 13:33:16 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-03-30 13:33:16 +0200 |
commit | 9ce5e4b01fcc8bf1805e97e162dd28bba3a7d251 (patch) | |
tree | 15ea95aecc0b12b3b8a56ea45e38d9c05912968b /tests | |
parent | 0e687993c8afb36876e7d90c229b97b4aaf43b70 (diff) | |
download | nextcloud-server-9ce5e4b01fcc8bf1805e97e162dd28bba3a7d251.tar.gz nextcloud-server-9ce5e4b01fcc8bf1805e97e162dd28bba3a7d251.zip |
Non moveable mount points should always be UPDATE+DELETE shareable
Fixes #23536
The new sharing code is much stricter in checking permissions. However
for non moveable mounts the permissions UPDATE+DELETE are not reported
on the mount point.
This is just a quick fix.
* Updated unit tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/share20/managertest.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/share20/managertest.php b/tests/lib/share20/managertest.php index 2f45de86b98..029c8cd8543 100644 --- a/tests/lib/share20/managertest.php +++ b/tests/lib/share20/managertest.php @@ -640,10 +640,21 @@ class ManagerTest extends \Test\TestCase { $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, null, null, null), 'A share requires permissions', true]; $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_LINK, $limitedPermssions, null, $user0, $user0, null, null, null), 'A share requires permissions', true]; + $mount = $this->getMock('OC\Files\Mount\MoveableMount'); + $limitedPermssions->method('getMountPoint')->willReturn($mount); + $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_USER, $limitedPermssions, $user2, $user0, $user0, 31, null, null), 'Cannot increase permissions of path', true]; $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, 17, null, null), 'Cannot increase permissions of path', true]; $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Cannot increase permissions of path', true]; + $nonMoveableMountPermssions = $this->getMock('\OCP\Files\File'); + $nonMoveableMountPermssions->method('isShareable')->willReturn(true); + $nonMoveableMountPermssions->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_READ); + $nonMoveableMountPermssions->method('getPath')->willReturn('path'); + + $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_USER, $nonMoveableMountPermssions, $user2, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false]; + $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $nonMoveableMountPermssions, $group0, $user0, $user0, 11, null, null), 'Cannot increase permissions of path', false]; + $rootFolder = $this->getMock('\OCP\Files\Folder'); $rootFolder->method('isShareable')->willReturn(true); $rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL); |