From b765a7958d5d8602d0f8cc3b23b07cfa4f304208 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 18 Mar 2013 23:33:41 +0200 Subject: Move snippets to own tab as feature. Make it disabled for new projects by default --- app/controllers/snippets_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers/snippets_controller.rb') diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 26898abfa82..d356479330b 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -1,4 +1,5 @@ class SnippetsController < ProjectResourceController + before_filter :module_enabled before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw] # Allow read any snippet @@ -84,4 +85,8 @@ class SnippetsController < ProjectResourceController def authorize_admin_snippet! return render_404 unless can?(current_user, :admin_snippet, @snippet) end + + def module_enabled + return render_404 unless @project.snippet_enabled + end end -- cgit v1.2.1