Commit 18fe957a57ab54bd88eccfefbf75e68ddcbecaa5

Authored by Rafael Manzo
Committed by Paulo Meireles
1 parent 6c5d0181

[Mezuro] Only persons can create configurations and only communities can create projects

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
plugins/mezuro/lib/mezuro_plugin.rb
... ... @@ -19,8 +19,11 @@ class MezuroPlugin < Noosfero::Plugin
19 19 end
20 20  
21 21 def control_panel_buttons
22   - [{:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} },
23   - {:title => _('Mezuro Configuration'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ConfigurationContent'} }]
  22 + if context.profile.is_a?(Community)
  23 + {:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} }
  24 + else
  25 + {:title => _('Mezuro Configuration'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ConfigurationContent'} }
  26 + end
24 27 end
25 28  
26 29  
... ...