When creating a share with
| path | / |
| shareType | 3 |
- Then the OCS status code should be "403"
\ No newline at end of file
+ Then the OCS status code should be "403"
+
+ Scenario: Allow modification of reshare
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And user "user0" created a folder "/TMP"
+ And file "TMP" of user "user0" is shared with user "user1"
+ And file "TMP" of user "user1" is shared with user "user2"
+ And As an "user1"
+ When Updating last share with
+ | permissions | 1 |
+ Then the OCS status code should be "100"
$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];
+ $rootFolder = $this->getMock('\OCP\Files\Folder');
+ $rootFolder->method('isShareable')->willReturn(true);
+ $rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
+ $rootFolder->method('getPath')->willReturn('myrootfolder');
+
+ $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_USER, $rootFolder, $user2, $user0, $user0, 30, null, null), 'You can\'t share your root folder', true];
+ $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $rootFolder, $group0, $user0, $user0, 2, null, null), 'You can\'t share your root folder', true];
+ $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_LINK, $rootFolder, null, $user0, $user0, 16, null, null), 'You can\'t share your root folder', true];
+
$allPermssions = $this->getMock('\OCP\Files\Folder');
$allPermssions->method('isShareable')->willReturn(true);
$allPermssions->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
]));
$userFolder = $this->getMock('\OCP\Files\Folder');
+ $userFolder->method('getPath')->willReturn('myrootfolder');
$this->rootFolder->method('getUserFolder')->willReturn($userFolder);
+
try {
$this->invokePrivate($this->manager, 'generalCreateChecks', [$share]);
$thrown = false;