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

obey to config in share mail notifications APIs #36161

Merged
merged 1 commit into from Sep 11, 2019
Merged

Conversation

karakayasemi
Copy link
Contributor

Description

We have two different admin options (public link and internal mail) for enabling/disabling share mail notifications, but APIs don't obey to this config. This pr fixes this behavior.

Related Issue

Motivation and Context

Fighting with bugs.

How Has This Been Tested?

Manually with Curl and unit test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@codecov
Copy link

codecov bot commented Sep 5, 2019

Codecov Report

Merging #36161 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #36161   +/-   ##
=======================================
  Coverage   54.01%   54.01%           
=======================================
  Files          63       63           
  Lines        7404     7404           
  Branches     1309     1309           
=======================================
  Hits         3999     3999           
  Misses       3019     3019           
  Partials      386      386
Flag Coverage Δ
#javascript 54.01% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce786ac...8d629c5. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 5, 2019

Codecov Report

Merging #36161 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #36161   +/-   ##
=======================================
  Coverage   54.01%   54.01%           
=======================================
  Files          63       63           
  Lines        7404     7404           
  Branches     1309     1309           
=======================================
  Hits         3999     3999           
  Misses       3019     3019           
  Partials      386      386
Flag Coverage Δ
#javascript 54.01% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73491f9...8c962f8. Read the comment docs.

@@ -75,6 +80,10 @@ public function __construct(
* @return Result
*/
public function notifyPublicLinkRecipientsByEmail($link, $recipients, $personalNote) {
if ($this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') !== 'yes') {
$message = "Public link mail notification is not allowed";
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to be inside the t function for transifex to pick up the text properly, otherwise we might not get the translations for that message.

@karakayasemi
Copy link
Contributor Author

@jvillafanez I applied suggested changes. Please review one more time. Thanks.

@jvillafanez
Copy link
Member

I kind of have to complain about files_sharing using configuration for core. If it's a setting for core it should be core the one managing that setting, files_sharing shouldn't care about it.
A better solution would probably be to use some kind of service managed by core to send those email, so the restrictions are place there, but this will require a lot of time.

We can go with this solution, but I think we should include a fixme.

@karakayasemi
Copy link
Contributor Author

@jvillafanez instead of adding a fixme, I moved the controls to core as you suggested. Please review one more time. Thank you.

@micbar micbar merged commit 0dafa3f into master Sep 11, 2019
@delete-merged-branch delete-merged-branch bot deleted the obey-mail-config branch September 11, 2019 07:19
@micbar micbar mentioned this pull request Sep 16, 2019
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants