summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-23 12:08:03 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-04-23 12:08:03 +0300
commit71f6143552a47209d4d83c35260db608cac7de1a (patch)
treeb5c16ae980c71adc7af6ef803369d2f0f33d4bb3 /app/controllers/snippets_controller.rb
parent63c5911961909b12b328b4182ba0f4b0e13c1bd6 (diff)
parentaac27550457eaf0503ce9bf7b04c18141ed317af (diff)
downloadgitlab-ce-71f6143552a47209d4d83c35260db608cac7de1a.tar.gz
Merge branch 'master' into new-sidebar
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: app/controllers/snippets_controller.rb
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 6c84dbbb998..a5259466cb8 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -1,11 +1,15 @@
class SnippetsController < ApplicationController
- before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw]
- before_filter :authorize_modify_snippet!, only: [:edit, :update]
- before_filter :authorize_admin_snippet!, only: [:destroy]
+ before_action :snippet, only: [:show, :edit, :destroy, :update, :raw]
- before_filter :set_title
+ # Allow modify snippet
+ before_action :authorize_modify_snippet!, only: [:edit, :update]
- skip_before_filter :authenticate_user!, only: [:index, :user_index, :show, :raw]
+ # Allow destroy snippet
+ before_action :authorize_admin_snippet!, only: [:destroy]
+
+ before_action :set_title
+
+ skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw]
respond_to :html