summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
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