Skip to content

Respect sharing options when searching using MailPlugin #7428 - #7490

Merged
MorrisJobke merged 2 commits into
masterfrom
fix_7428
Dec 18, 2017
Merged

Respect sharing options when searching using MailPlugin #7428#7490
MorrisJobke merged 2 commits into
masterfrom
fix_7428

Conversation

@LEDfan

@LEDfanLEDfan commented Dec 13, 2017

Copy link
Copy Markdown
Member

I think I found the problem with #7428, basically when a user gr2_foo has set an email address and is in group gr2 and a user of gr1 tries to share something gr2_foo will show up. This is of course because there is a match based on the email address. However there shouldn't be searched for systemusers using the mail plugin, because there is the UserPlugin.

This can very easily be backported to 12 (I have already pushed a branch) if wanted.

@codecov

codecovBot commented Dec 14, 2017

Copy link
Copy Markdown

Codecov Report

Merging #7490 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@ Coverage Diff @@## master #7490 +/- ##
============================================
+ Coverage 51.16% 51.18% +0.01% - Complexity 24866 24870 +4 
============================================
Files 1601 1601 Lines 94684 94696 +12 Branches 1368 1368 ============================================
+ Hits 48448 48468 +20 + Misses 46236 46228 -8
Impacted FilesCoverage ΔComplexity Δ
...private/Collaboration/Collaborators/MailPlugin.php72.82% <100%> (+14.07%)23 <1> (+4)⬆️
lib/private/Security/CertificateManager.php91.08% <0%> (-1%)39% <0%> (ø)
apps/files_trashbin/lib/Trashbin.php72.28% <0%> (-0.25%)136% <0%> (ø)
lib/private/Server.php81.01% <0%> (+0.11%)134% <0%> (ø)⬇️
lib/private/Files/Cache/Propagator.php96.2% <0%> (+1.26%)16% <0%> (ø)⬇️

@LEDfan

Copy link
Copy Markdown
MemberAuthor

Mmm, actually, it seems like my fix isn't 100% correct, because now if you type the full e-mail address the user won't show up....

… we may share with
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
@LEDfan

Copy link
Copy Markdown
MemberAuthor

I managed to create a better fix. The commit 9d60f7f is now fixing:

Steps to reproduce

  1. create groups gr1 and gr2, create users gr1_foo, gr1_bar1, gr2_foo and gr2_bar, add the users to the corresponding groups
  2. add the email email@email.be to gr1_foo and add the email abc@abc.be to gr2_bar
  3. without changing settings you should now be able to lookup all users and gr2_bar and gr1_foo by their email addresses
  4. enable the option shareapi_only_share_with_group_members

Expected behaviour

  1. only users in your own group should show up
  2. searching for abc or email should not popup users from other groups

Actual behaviour

  1. the other users do show up

@LEDfanLEDfan changed the title Don't load system users when searching by email in Collaborators fixes #7428Don't show other groups when searching for #7428Dec 15, 2017
@LEDfanLEDfan changed the title Don't show other groups when searching for #7428Respect sharing options when searching using MailPlugin #7428Dec 15, 2017

@blizzzblizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good and works

@blizzz

Copy link
Copy Markdown
Member

Tests need to be adjusted, though

Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
@LEDfan

Copy link
Copy Markdown
MemberAuthor

@blizzz I fixed the tests and add some test cases for this patch.

@MorrisJobkeMorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@MorrisJobke
MorrisJobke merged commit 3da92a9 into masterDec 18, 2017
@MorrisJobke
MorrisJobke deleted the fix_7428 branch December 18, 2017 13:08
@MorrisJobkeMorrisJobke added this to the Nextcloud 13 milestone Dec 18, 2017
@MorrisJobke

Copy link
Copy Markdown
Member

This can very easily be backported to 12 (I have already pushed a branch) if wanted.

Yes - please open a backport PR.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@LEDfan@blizzz@MorrisJobke@rullzer