Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let resharer to send an e-mail for public link #36393

Merged
merged 1 commit into from Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/36393
@@ -0,0 +1,6 @@
Bugfix: allow re-sharer to send an e-mail for public link

Sending an e-mail when creating public links from received shares was impossible. This problem fixed.

https://github.com/owncloud/core/issues/36386
https://github.com/owncloud/core/pull/36393
2 changes: 1 addition & 1 deletion lib/private/Share/MailNotifications.php
Expand Up @@ -229,7 +229,7 @@ public function sendLinkShareMail($sender, $recipients, $link, $personalNote = n
$token = \array_pop($linkParts);
try {
$share = $this->shareManager->getShareByToken($token);
if ($share->getShareOwner() !== $currentUser) {
if ($share->getShareOwner() !== $currentUser && $share->getSharedBy() !== $currentUser) {
return $recipients;
}
} catch (ShareNotFound $e) {
Expand Down
Expand Up @@ -18,20 +18,15 @@ Feature: Reshare by public link
And the public accesses the last created public link using the webUI
Then file "lorem.txt" should be listed on the webUI

@issue-36386
Scenario: user shares a public link via email
Given user "user1" has created folder "/simple-folder"
And user "user1" has shared folder "/simple-folder" with user "user2" with permissions "share,read"
And parameter "shareapi_allow_public_notification" of app "core" has been set to "yes"
And user "user2" has logged in using the webUI
#When the user creates a new public link for folder "simple-folder" using the webUI with
When the user tries to create a new public link for folder "simple-folder" using the webUI with
When the user creates a new public link for folder "simple-folder" using the webUI with
| email | foo@bar.co |
#Then the email address "foo@bar.co" should have received an email with the body containing
# """
# User Two shared simple-folder with you
# """
#And the email address "foo@bar.co" should have received an email containing the last shared public link
Then dialog should be displayed on the webUI
| title | content |
| An error occured while sending email | Couldn't send mail to following recipient(s): foo@bar.co |
Then the email address "foo@bar.co" should have received an email with the body containing
"""
User Two shared simple-folder with you
"""
And the email address "foo@bar.co" should have received an email containing the last shared public link