[Git][noosfero/noosfero][master] 2 commits: Fixes show_newsletter? method on public access restriction plugin

Rodrigo Souto gitlab at mg.gitlab.com
Wed Sep 26 15:56:39 BRT 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
f9e0c5b6 by Matheus Richard at 2018-09-26T14:10:24Z
Fixes show_newsletter? method on public access restriction plugin

- - - - -
0e989101 by Rodrigo Souto at 2018-09-26T18:56:37Z
Merge branch 'fixes-show-newsletter' into 'master'

Fixes show_newsletter method on public access restriction plugin

See merge request noosfero/noosfero!1615
- - - - -


1 changed file:

- plugins/public_access_restriction/lib/public_access_restriction_plugin.rb


Changes:

=====================================
plugins/public_access_restriction/lib/public_access_restriction_plugin.rb
=====================================
@@ -71,16 +71,7 @@ class PublicAccessRestrictionPlugin < Noosfero::Plugin
   def show_newsletter? environment, profile
     if environment.enabled_plugins.include?("NewsletterPlugin")
       newsletter = NewsletterPlugin::Newsletter.find_by(environment: environment.id)
-      on_newsletter = params['controller'] == 'newsletter_plugin' && params['action'] == 'mailing'
-      on_newsletter_blog = false
-
-      if newsletter
-        on_newsletter_blog = newsletter.blogs.find_by(profile: profile)
-      end
-
-      on_newsletter || on_newsletter_blog
-    else
-      false
+      newsletter.blogs.find_by(profile: profile)
     end
   end
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/b987fbe717f8cd56c2b69ab8b90a795509dc7dda...0e989101a5770f33f95bd2fd6f2dca2fe4afe27a

-- 
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/b987fbe717f8cd56c2b69ab8b90a795509dc7dda...0e989101a5770f33f95bd2fd6f2dca2fe4afe27a
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180926/30a2995b/attachment-0001.html>


More information about the Noosfero-dev mailing list