summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-18 23:33:41 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-18 23:33:41 +0200
commitb765a7958d5d8602d0f8cc3b23b07cfa4f304208 (patch)
tree412361c9ec0b838abc0cd38527e4d34991dc6be2 /app/controllers/snippets_controller.rb
parent112dc875ba325cfb0b223165c20d8424698e7791 (diff)
downloadgitlab-ce-b765a7958d5d8602d0f8cc3b23b07cfa4f304208.tar.gz
Move snippets to own tab as feature. Make it disabled for new projects by default
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb5
1 files changed, 5 insertions, 0 deletions
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