Skip to content

Commit 503d5f8

Browse files
committed
fix(files_sharing): Filter own shares that are reshares
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 119727d commit 503d5f8

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

apps/files_sharing/lib/MountProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getMountsForUser(IUser $user, IStorageFactory $loader) {
5353

5454
// filter out excluded shares and group shares that includes self
5555
$shares = array_filter($shares, function (\OCP\Share\IShare $share) use ($user) {
56-
return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID();
56+
return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID() && $share->getSharedBy() !== $user->getUID();
5757
});
5858

5959
$superShares = $this->buildSuperShares($shares, $user);

build/integration/files_features/transfer-ownership.feature

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,10 @@ Feature: transfer-ownership
210210
And user "user1" accepts last share
211211
When transferring ownership from "user0" to "user1"
212212
And the command was successful
213-
And As an "user1"
214-
Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is"
215213
And using old dav path
216214
And as "user0" the folder "/test" exists
217215
And using received transfer folder of "user1" as dav path
218216
And as "user1" the folder "/test" does not exist
219-
And As an "user1"
220-
And Getting info of last share
221-
And the OCS status code should be "100"
222-
And Share fields of last share match with
223-
| uid_owner | user1 |
224-
| uid_file_owner | user3 |
225-
| share_with | group1 |
226217

227218
Scenario: transferring ownership of folder reshared with group to a user not in the group
228219
Given user "user0" exists

0 commit comments

Comments
 (0)