diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-19 01:33:41 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-03-19 01:33:41 +0400 |
commit | b765a7958d5d8602d0f8cc3b23b07cfa4f304208 (patch) | |
tree | 412361c9ec0b838abc0cd38527e4d34991dc6be2 /app/controllers/snippets_controller.rb | |
parent | 112dc875ba325cfb0b223165c20d8424698e7791 (diff) |
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.rb | 5 |
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 |