diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-26 17:44:21 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-26 17:44:21 +0300 |
commit | d63371ad783db055da840be37ddac0cdcb49db2c (patch) | |
tree | afb0b00befbf10caaf5c617db1e72cad35ad75f9 /app/controllers/snippets_controller.rb | |
parent | 342d5537091e61c1fc52f3e54df926159f326eb8 (diff) |
Update controller filters
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r-- | app/controllers/snippets_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 0ca71c155c5..8e7e45c781f 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -2,7 +2,7 @@ class SnippetsController < ApplicationController before_action :snippet, only: [:show, :edit, :destroy, :update, :raw] # Allow modify snippet - before_action :authorize_modify_snippet!, only: [:edit, :update] + before_action :authorize_update_snippet!, only: [:edit, :update] # Allow destroy snippet before_action :authorize_admin_snippet!, only: [:destroy] @@ -87,7 +87,7 @@ class SnippetsController < ApplicationController end end - def authorize_modify_snippet! + def authorize_update_snippet! return render_404 unless can?(current_user, :update_personal_snippet, @snippet) end |