Commit da6fec43ce1666f60ebf64e8c5c48da495931b63

Authored by Evandro Junior
2 parents 4fd2a0c0 725c7c99
Exists in master

Fixed permissions

controllers/email_article_plugin_myprofile_controller.rb
1 class EmailArticlePluginMyprofileController < MyProfileController 1 class EmailArticlePluginMyprofileController < MyProfileController
2 2
3 needs_profile 3 needs_profile
4 -  
5 # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add] 4 # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add]
6 # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail] 5 # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail]
7 # before_filter :login_required, :only => [:add, :join, :join_not_logged, :leave, :unblock, :leave_scrap, :remove_scrap, :remove_activity, :view_more_activities, :view_more_network_activities, :report_abuse, :register_report, :leave_comment_on_activity, :send_mail] 6 # before_filter :login_required, :only => [:add, :join, :join_not_logged, :leave, :unblock, :leave_scrap, :remove_scrap, :remove_activity, :view_more_activities, :view_more_network_activities, :report_abuse, :register_report, :leave_comment_on_activity, :send_mail]
lib/email_article_plugin.rb
@@ -12,8 +12,9 @@ class EmailArticlePlugin &lt; Noosfero::Plugin @@ -12,8 +12,9 @@ class EmailArticlePlugin &lt; Noosfero::Plugin
12 label = _("Send article to members") 12 label = _("Send article to members")
13 htmlclass = _("button with-text icon-menu-mail") 13 htmlclass = _("button with-text icon-menu-mail")
14 title = _("Email article to all community members") 14 title = _("Email article to all community members")
  15 +
15 lambda { 16 lambda {
16 - if user.is_admin?(profile) and @page.kind_of?(TextArticle) 17 + if !profile.blank? and !user.blank? and user.is_admin?(profile) and @page.kind_of?(TextArticle)
17 link_to_remote( 18 link_to_remote(
18 label, 19 label,
19 { 20 {
@@ -26,7 +27,7 @@ class EmailArticlePlugin &lt; Noosfero::Plugin @@ -26,7 +27,7 @@ class EmailArticlePlugin &lt; Noosfero::Plugin
26 :class => htmlclass, 27 :class => htmlclass,
27 :title => title 28 :title => title
28 ) 29 )
29 - end 30 + end
30 } 31 }
31 end 32 end
32 end 33 end