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.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