app/controllers/tr8n/admin/base_controller.rb in tr8n-3.1.8 vs app/controllers/tr8n/admin/base_controller.rb in tr8n-3.2.0

- old
+ new

@@ -1,7 +1,7 @@ #-- -# Copyright (c) 2010-2011 Michael Berkovich, tr8n.net +# Copyright (c) 2010-2012 Michael Berkovich, tr8n.net # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, @@ -48,15 +48,18 @@ {"title" => "Translation Keys", "description" => "Admin tab", "controller" => "translation_key"}, {"title" => "Translations", "description" => "Admin tab", "controller" => "translation"}, {"title" => "Translators", "description" => "Admin tab", "controller" => "translator"}, {"title" => "Glossary", "description" => "Admin tab", "controller" => "glossary"}, {"title" => "Forum", "description" => "Admin tab", "controller" => "forum"}, + {"title" => "Metrics", "description" => "Metrics tab", "controller" => "metrics"}, {"title" => "Client SDK", "description" => "Admin tab", "controller" => "clientsdk"} ] end helper_method :tr8n_admin_tabs def validate_admin + return if Tr8n::Config.env == 'development' + unless tr8n_current_user_is_admin? trfe("You must be an admin in order to view this section of the site") redirect_to_site_default_url end end \ No newline at end of file