From 18fe957a57ab54bd88eccfefbf75e68ddcbecaa5 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo + Diego Araújo Date: Tue, 18 Sep 2012 16:08:30 -0300 Subject: [PATCH] [Mezuro] Only persons can create configurations and only communities can create projects --- plugins/mezuro/lib/mezuro_plugin.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/mezuro/lib/mezuro_plugin.rb b/plugins/mezuro/lib/mezuro_plugin.rb index 635526f..07c8759 100644 --- a/plugins/mezuro/lib/mezuro_plugin.rb +++ b/plugins/mezuro/lib/mezuro_plugin.rb @@ -19,8 +19,11 @@ class MezuroPlugin < Noosfero::Plugin end def control_panel_buttons - [{:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} }, - {:title => _('Mezuro Configuration'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ConfigurationContent'} }] + if context.profile.is_a?(Community) + {:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} } + else + {:title => _('Mezuro Configuration'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ConfigurationContent'} } + end end -- libgit2 0.21.2