summaryrefslogtreecommitdiff
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-26 16:39:17 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-26 16:39:17 +0000
commit9f166a864959370d3e31931519506887b902cd11 (patch)
tree62bc450c637f9c0861bfb5964ffcdaec4e4fd0b5 /app/controllers/snippets_controller.rb
parent06ab7d89f9835205ee4d2dfd64aac671a7efa891 (diff)
parent7ca017b5130705770074d455cbc827e487730bf1 (diff)
downloadgitlab-ce-9f166a864959370d3e31931519506887b902cd11.tar.gz
Merge branch 'rename-abilities' into 'master'
Rename abilities to correspond contoller/model action names write_ was renamed to create_ modify_ was renamed to update_ So now in update action we have next code ``` def create can?(current_user, :create_issue, @issue) end def update can?(current_user, :update_issue, @issue) end ``` See merge request !896
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index cf672c5c093..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,8 +87,8 @@ class SnippetsController < ApplicationController
end
end
- def authorize_modify_snippet!
- return render_404 unless can?(current_user, :modify_personal_snippet, @snippet)
+ def authorize_update_snippet!
+ return render_404 unless can?(current_user, :update_personal_snippet, @snippet)
end
def authorize_admin_snippet!